如何告诉pip在哪里可以找到安装软件包所必需的依赖项?包是pybgpstream,依赖项是bgpstream

时间:2019-11-26 15:09:12

标签: python pip bgp

我想使用bgpstream。我安装了它。我在命令行中使用BGPReader对其进行了测试,似乎一切正常。

现在,我想安装pybgpstream以在我的python脚本中使用该工具。要安装pybgpstream,您首先必须安装bgpstream。如上所述,它已经安装。

这是我尝试安装时发生的事情:

$ pip3 install pybgpstream
Collecting pybgpstream
  Using cached https://files.pythonhosted.org/packages/1d/8b/a4ae40e2e822635b0477c763fdfc6fe8cfa302dfae9410706d146f364390/pybgpstream-2.0.0.tar.gz
Collecting python-dateutil (from pybgpstream)
  Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil->pybgpstream)
  Using cached https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Building wheels for collected packages: pybgpstream
  Running setup.py bdist_wheel for pybgpstream ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3huxqvfq/pybgpstream/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpeev3myvupip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/pybgpstream
  copying pybgpstream/__init__.py -> build/lib.linux-x86_64-3.6/pybgpstream
  copying pybgpstream/pybgpstream.py -> build/lib.linux-x86_64-3.6/pybgpstream
  running build_ext
  building '_pybgpstream' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c src/_pybgpstream_version.c -o build/temp.linux-x86_64-3.6/src/_pybgpstream_version.o
  src/_pybgpstream_version.c:30:3: error: #error "pybgpstream requires libbgpstream 2.0.0 or later"
    #error "pybgpstream requires libbgpstream 2.0.0 or later"
     ^~~~~
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pybgpstream
  Running setup.py clean for pybgpstream
Failed to build pybgpstream
Installing collected packages: six, python-dateutil, pybgpstream
  Running setup.py install for pybgpstream ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3huxqvfq/pybgpstream/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-54dwua9s-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/pybgpstream
    copying pybgpstream/__init__.py -> build/lib.linux-x86_64-3.6/pybgpstream
    copying pybgpstream/pybgpstream.py -> build/lib.linux-x86_64-3.6/pybgpstream
    running build_ext
    building '_pybgpstream' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c src/_pybgpstream_version.c -o build/temp.linux-x86_64-3.6/src/_pybgpstream_version.o
    src/_pybgpstream_version.c:30:3: error: #error "pybgpstream requires libbgpstream 2.0.0 or later"
      #error "pybgpstream requires libbgpstream 2.0.0 or later"
       ^~~~~
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3huxqvfq/pybgpstream/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-54dwua9s-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-3huxqvfq/pybgpstream/

事实告诉我他找不到“ libbgpstream 2.0.0”。它实际上位于/ usr / local / lib中,称为libbgpstream.so.2.0.0!

我已经喜欢在https://bgpstream.caida.org/docs/install/pybgpstream中说过:

LD_LIBRARY_PATH=/usr/local/lib/libbgpstream.so.2.0.0

感谢您的阅读。 你能帮我吗?

此致

1 个答案:

答案 0 :(得分:0)

我终于将操作系统(ubuntu 18.04)更改为kali linux,以使用新的操作系统。 现在一切正常。

此致