在OSX 10.7.5上,我試圖使用pip3
命令將軟件包安裝到python3。當我嘗試,我收到此錯誤信息:pip3說「解決pkg_resources.DistributionNotFound:pip == 1.3.1」
zak$ pip3
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/setuptools-1.0-py3.3.egg/pkg_resources.py", line 2793, in <module>
File "/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/setuptools-1.0-py3.3.egg/pkg_resources.py", line 673, in require
File "/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/setuptools-1.0-py3.3.egg/pkg_resources.py", line 580, in resolve
pkg_resources.VersionConflict: (pip 1.4.1 (/usr/local/lib/python3.3/site-packages), Requirement.parse('pip==1.3.1'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "<frozen importlib._bootstrap>", line 1567, in _find_and_load
File "<frozen importlib._bootstrap>", line 1534, in _find_and_load_unlocked
File "/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/setuptools-1.0-py3.3.egg/pkg_resources.py", line 2797, in <module>
File "/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/setuptools-1.0-py3.3.egg/pkg_resources.py", line 576, in resolve
pkg_resources.DistributionNotFound: pip==1.3.1
看起來setuptools
要求很高的老版本PIP的(我已經安裝了1.4.1),但是爲什麼呢?我怎樣才能解決這個問題?
你有沒有安裝任何東西,還是使用Homebrew的'pip'開箱即用?我不會對後者感到驚訝,因爲setuptools 1.0是相當新穎的,並且有一些後向不兼容性,並且Homebrew的配方可能還沒有完全更新......但是,排除早期安裝中不兼容的剩菜將是很好的。 ,你已經分發了,然後安裝了一個最近的setuptools,而不用先卸載分發)。 – abarnert
另外,你有'PYTHONPATH'嗎?如果你在Python中打印(sys.path)',這些目錄中的任何目錄是否與你的機器上的其他Python安裝共享? – abarnert
經過一番混淆之後,我可以通過安裝一個Python.org 3.3(在PATH上放置'/ Library/Frameworks/Python.framework/Versions/3.3/bin'而不是鏈接到'/ usr/local/bin'),安裝pip 1.3.1及其最小的依賴關係,然後用它的pip 1.4.1安裝Homebrew 3.3。我最終用'/ usr/local/bin/pip3'作爲1.3.1 python.org腳本,但是指向'/ usr/local/bin/python3.3',這是Homebrew版本,它找到了pip 1.4 .1放在'/ usr/local/lib/python3.3/site-packages'中。 – abarnert