Skip to main content
 首页 » 编程设计

python之PIP安装不起作用(六、numpy和python-dateutil要求)

2024年09月07日9cmt

我是 Python 的新手,想在 Mac 上为 Python 3.5 安装 Pillow 包。我使用 pip install pillow 命令并收到此错误:

Jaspers-MBP:~ jasperherrmann$ pip install pillow 
Collecting pillow 
  Using cached Pillow-5.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl 
prompt-toolkit 1.0.15 has requirement six>=1.9.0, but you'll have six  
1.4.1 which is incompatible. 
pandas 0.22.0 has requirement numpy>=1.9.0, but you'll have numpy 1.8.0rc1 which is incompatible. 
html5lib 1.0.1 has requirement six>=1.9, but you'll have six 1.4.1 which is incompatible. 
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible. 
jupyter-client 5.2.3 has requirement python-dateutil>=2.1, but you'll have python-dateutil 1.5 which is incompatible. 
Installing collected packages: pillow 

所以我继续尝试使用 pip install six、pip install numpy 和 pip 安装 pandas、html5lib 等似乎需要的所有东西安装 python-dateutil 并得到下一个错误(对于所有相同的命令):

Jaspers-MBP:~ jasperherrmann$ pip install six 
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.4.1) 
prompt-toolkit 1.0.15 has requirement six>=1.9.0, but you'll have six 1.4.1 which is incompatible. 
pandas 0.22.0 has requirement numpy>=1.9.0, but you'll have numpy 1.8.0rc1 which is incompatible. 
html5lib 1.0.1 has requirement six>=1.9, but you'll have six 1.4.1 which is incompatible. 
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible. 
jupyter-client 5.2.3 has requirement python-dateutil>=2.1, but you'll have python-dateutil 1.5 which is incompatible. 

所以我认为好的 6,其他的已经存在,我只需要使用 pip install --upgrade six 命令升级它们。这是我得到的最后一个错误,现在不知道如何继续:

Jaspers-MBP:~ jasperherrmann$ pip install --upgrade six 
Collecting six 
  Using cached six-1.11.0-py2.py3-none-any.whl 
pandas 0.22.0 has requirement numpy>=1.9.0, but you'll have numpy 1.8.0rc1 which is incompatible. 
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible. 
jupyter-client 5.2.3 has requirement python-dateutil>=2.1, but you'll have python-dateutil 1.5 which is incompatible. 
Installing collected packages: six 
  Found existing installation: six 1.4.1 
Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. 
Jaspers-MBP:~ jasperherrmann$  

所以我被卡住了,如果你们中的一些人能解决我的问题,我会很高兴:-)

请您参考如下方法:

只需执行 pip install --ignore-installed pillow,应该可以解决您的问题。