Python pip没有从requirements.txt完全安装软件包

Python pip没有从requirements.txt完全安装软件包,python,raspberry-pi,Python,Raspberry Pi,我正在尝试从raspberry pi上的requirements.txt文件安装python依赖项。这在我最初测试的ubuntu虚拟机映像上运行良好,所以我有点困惑 当我运行pip3安装-r requirements.txt时 Collecting coverage Downloading https://www.piwheels.org/simple/coverage/coverage-4.5.1-cp35-cp35m-linux_armv6l.whl (208kB) 100% |

我正在尝试从raspberry pi上的requirements.txt文件安装python依赖项。这在我最初测试的ubuntu虚拟机映像上运行良好,所以我有点困惑

当我运行
pip3安装-r requirements.txt时

Collecting coverage
  Downloading https://www.piwheels.org/simple/coverage/coverage-4.5.1-cp35-cp35m-linux_armv6l.whl (208kB)
    100% |████████████████████████████████| 215kB 131kB/s 
Collecting Django
  Downloading Django-2.0.4-py3-none-any.whl (7.1MB)
    100% |████████████████████████████████| 7.1MB 8.9kB/s 
....
输出中没有错误,因此我添加了
-v
标志并再次运行:

pip3安装-v-r requirements.txt

Collecting coverage
  Downloading https://www.piwheels.org/simple/coverage/coverage-4.5.1-cp35-cp35m-linux_armv6l.whl (208kB)
    100% |████████████████████████████████| 215kB 131kB/s 
Collecting Django
  Downloading Django-2.0.4-py3-none-any.whl (7.1MB)
    100% |████████████████████████████████| 7.1MB 8.9kB/s 
....
几乎相同的输出,包括所有您希望找到正确包、连接到源代码等的内容

要确认未安装任何软件包,请执行以下操作:

pip3显示

它只返回一个没有输出的提示

那么,我只是下载软件包而不是安装它们?怎么回事

这是我的要求文件:

certifi==2017.11.5
chardet==3.0.4
coverage==4.4.2
Django==2.0.1
gitdb2==2.0.3
GitPython==2.1.9
gunicorn==19.7.1
idna==2.6
netifaces==0.10.6
nose==1.3.7
psycopg2==2.7.3.2
python-nmap==0.6.1
pytz==2017.3
requests==2.18.4
simplejson==3.13.2
smmap2==2.0.3
urllib3==1.22
xml2json==0.1
但是,如果我尝试逐个安装这些软件包,它可以正常工作:

> pip install certifi
Collecting certifi
  Downloading certifi-2018.1.18-py2.py3-none-any.whl (151kB)
    100% |████████████████████████████████| 153kB 187kB/s 
Installing collected packages: certifi
Successfully installed certifi-2018.1.18
所以,我不认为这是一个依赖性问题

这是完整的输出,请注意,我已经尝试运行过一次,并且软件包已经下载,我手动运行了
pip install certifi
&
pip install chardet
,以显示当一次只尝试安装一个软件包时,该命令起作用:

root@omniscanner:~# pip3 install -r /opt/omnicron-scanner/requirements.txt 
Collecting certifi==2017.11.5 (from -r /opt/omnicron-scanner/requirements.txt (line 1))
  Using cached certifi-2017.11.5-py2.py3-none-any.whl
Requirement already satisfied: chardet==3.0.4 in /usr/local/lib/python3.5/dist-packages (from -r /opt/omnicron-scanner/requirements.txt (line 2))
Collecting coverage==4.4.2 (from -r /opt/omnicron-scanner/requirements.txt (line 3))
  Using cached https://www.piwheels.org/simple/coverage/coverage-4.4.2-cp35-cp35m-linux_armv6l.whl
Collecting Django==2.0.1 (from -r /opt/omnicron-scanner/requirements.txt (line 4))
  Using cached Django-2.0.1-py3-none-any.whl
Collecting gitdb2==2.0.3 (from -r /opt/omnicron-scanner/requirements.txt (line 5))
  Using cached gitdb2-2.0.3-py2.py3-none-any.whl
Collecting GitPython==2.1.9 (from -r /opt/omnicron-scanner/requirements.txt (line 6))
  Using cached GitPython-2.1.9-py2.py3-none-any.whl
Collecting gunicorn==19.7.1 (from -r /opt/omnicron-scanner/requirements.txt (line 7))
  Using cached gunicorn-19.7.1-py2.py3-none-any.whl
Collecting idna==2.6 (from -r /opt/omnicron-scanner/requirements.txt (line 8))
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting netifaces==0.10.6 (from -r /opt/omnicron-scanner/requirements.txt (line 9))
  Using cached https://www.piwheels.org/simple/netifaces/netifaces-0.10.6-cp35-cp35m-linux_armv6l.whl
Collecting nose==1.3.7 (from -r /opt/omnicron-scanner/requirements.txt (line 10))
  Using cached nose-1.3.7-py3-none-any.whl
Collecting psycopg2==2.7.3.2 (from -r /opt/omnicron-scanner/requirements.txt (line 11))
  Using cached https://www.piwheels.org/simple/psycopg2/psycopg2-2.7.3.2-cp35-cp35m-linux_armv6l.whl
Collecting python-nmap==0.6.1 (from -r /opt/omnicron-scanner/requirements.txt (line 12))
  Using cached https://www.piwheels.org/simple/python-nmap/python_nmap-0.6.1-py3-none-any.whl
Collecting pytz==2017.3 (from -r /opt/omnicron-scanner/requirements.txt (line 13))
  Using cached pytz-2017.3-py2.py3-none-any.whl
Collecting requests==2.18.4 (from -r /opt/omnicron-scanner/requirements.txt (line 14))
  Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting simplejson==3.13.2 (from -r /opt/omnicron-scanner/requirements.txt (line 15))
  Using cached https://www.piwheels.org/simple/simplejson/simplejson-3.13.2-cp35-cp35m-linux_armv6l.whl
Collecting smmap2==2.0.3 (from -r /opt/omnicron-scanner/requirements.txt (line 16))
  Using cached smmap2-2.0.3-py2.py3-none-any.whl
Collecting urllib3==1.22 (from -r /opt/omnicron-scanner/requirements.txt (line 17))
  Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting xml2json==0.1 (from -r /opt/omnicron-scanner/requirements.txt (line 18))
  Could not find a version that satisfies the requirement xml2json==0.1 (from -r /opt/omnicron-scanner/requirements.txt (line 18)) (from versions: 1.1)
No matching distribution found for xml2json==0.1 (from -r /opt/omnicron-scanner/requirements.txt (line 18))

在Raspbian Wheezy中,管理Python 3包的命令是
pip-3.2
,而不是
pip3
。这可能是个错误吗?另外,当您键入
pip3 freeze
时,软件包仍然没有显示?我安装了Jessie Lite,因此不得不手动安装。在本例中:
apt get install python3 python3 pip
。如果我运行
pip3 freeze
,它会列出包,但只列出标准包,这些包都不是我的
requirements.txt
文件的一部分;不需要bash标记。有趣的是,我同意@CharlesDuffy的观点,并认为这是一个python问题,因为它无法正确执行-r命令。从外观上看,它所做的只是为您下载软件包,您必须手动安装它们。这似乎是一个pip问题,因为这是一个如何安装软件包的问题。raspberry pi环境中的完整功能似乎没有正确实现。@Sraw-yup,你说得对。最后,我将
requirements.txt中的
==
更改为
=
,然后再次运行。。。都成功了!