Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/346.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过pip错误安装Python包_Python_Pip_Package_Installation - Fatal编程技术网

通过pip错误安装Python包

通过pip错误安装Python包,python,pip,package,installation,Python,Pip,Package,Installation,我试图通过pip3安装一些python软件包,但在大多数情况下,我都会遇到一些我不理解的错误。例如: root@turris:~# pip3 install pyshark Collecting pyshark Downloading pyshark-0.4.2.9-py3-none-any.whl (31 kB) Collecting py Downloading py-1.8.1-py2.py3-none-any.whl (83 kB) |█████████████████

我试图通过pip3安装一些python软件包,但在大多数情况下,我都会遇到一些我不理解的错误。例如:

root@turris:~# pip3 install pyshark
Collecting pyshark
  Downloading pyshark-0.4.2.9-py3-none-any.whl (31 kB)
Collecting py
  Downloading py-1.8.1-py2.py3-none-any.whl (83 kB)
     |████████████████████████████████| 83 kB 1.6 MB/s
Collecting lxml
  Downloading lxml-4.5.0.tar.gz (4.5 MB)
     |████████████████████████████████| 4.5 MB 3.6 MB/s
Installing collected packages: py, lxml, pyshark
    Running setup.py install for lxml ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eln_tufx/lxml/setup.py'"'"'                                                                     ; __file__='"'"'/tmp/pip-install-eln_tufx/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.c                                                                     lose();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0uhmqqdg/install-record.txt --single-version-externally-managed --compile --insta                                                                     ll-headers /usr/include/python3.6/lxml Check the logs for full command output.
我已经安装了python3.6和pip20.0.2。我已经更新了设置工具和控制盘。现在我明白了:

root@turris:~/skripty# python3.6 -m pip install numpy
Collecting numpy
  Using cached numpy-1.18.2.zip (5.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3.6 /usr/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpf_8xl1dr Check the logs for full command output.
我正在使用TurrisOS(修改的OpenWRT发行版)。有人知道怎么回事吗?谢谢

编辑: 好的,我通过以下方式修复了Pyshark包的错误:

opkg update
opkg install python3-lxml
pip3 install pyshark
但我在安装时仍遇到另一个错误,例如numpy

root@turris:~# pip3 install numpy
Collecting numpy
  Using cached numpy-1.18.2.zip (5.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp6bzl_666 Check the logs for full command output.
或另一个包和不同的错误:

root@turris:~# pip3 install matplotlib
Collecting matplotlib
  Downloading matplotlib-3.2.1.tar.gz (40.3 MB)
     |████████████████████████████████| 40.3 MB 11.3 MB/s
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.