簡體   English   中英

如何告訴 pip 在哪里可以找到安裝軟件包所需的依賴項? 包是pybgpstream,依賴是bgpstream

[英]How to tell pip where to find dependencies necessary to install a package ? The package is pybgpstream and the dependencies is 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('\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

感謝您的閱讀。 你可以幫幫我嗎 ?

問候,

我終於將我的操作系統(ubuntu 18.04)更改為 kali linux 以獲得全新的操作系統。 現在一切正常。

問候,

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM