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



我想使用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('rn', '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('rn', '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('rn', '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

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

问候

我终于将我的操作系统(ubuntu 18.04(更改为kali linux以拥有全新的操作系统。 现在一切正常。

问候

最新更新