我在Yosemite(10.10.2)上運行Python 2.7.9,並且我的pip安裝出錯了。 我可以使用get-pip.py
不再安裝PIP:嘗試使用pip安裝時出現AttributeError
sth:~ $ sudo python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 20204, in <module>
main()
File "get-pip.py", line 152, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 130, in bootstrap
sys.exit(pip.main(["install", "--upgrade"] + packages + args))
File "/tmp/tmpdUeSSr/pip.zip/pip/__init__.py", line 217, in main
File "/tmp/tmpdUeSSr/pip.zip/pip/basecommand.py", line 183, in main
File "/tmp/tmpdUeSSr/pip.zip/pip/compat/dictconfig.py", line 565, in dictConfig
File "/tmp/tmpdUeSSr/pip.zip/pip/compat/dictconfig.py", line 332, in configure
AttributeError: 'module' object has no attribute '_handlerList'
我可以使用easy_install
,然後在/usr/local/bin
創建符號鏈接到它,而是試圖用它給了我同樣的錯誤安裝,隨後:
sth:~ $ sudo pip install twine
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==6.0.8', 'console_scripts', 'pip')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/__init__.py", line 217, in main
return command.main(cmd_args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/basecommand.py", line 183, in main
for name in ["pip._vendor", "distlib", "requests", "urllib3"]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/compat/dictconfig.py", line 565, in dictConfig
dictConfigClass(config).configure()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/compat/dictconfig.py", line 332, in configure
del logging._handlerList[:]
AttributeError: 'module' object has no attribute '_handlerList'
我敢肯定它不是用PIP問題,所以想知道我做錯了......
看來由於某種原因,你的'logging'模塊已經過時了。通過'import logging;檢查你的版本;打印 logging .__ version__'。如果它已經過期,請運行'easy_install logging'。 – dmg 2015-02-06 12:56:41