ubuntu下pip出错的临时解决办法

今天pip突然出问题了:

Traceback (most recent call last):
File “/usr/bin/pip”, line 9, in

load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()   

File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 356, in load_entry_point

return get_distribution(dist).load_entry_point(group, name)  

File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2476, in load_entry_point

return ep.load()  

File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2190, in load

['__name__'])  

File “/usr/lib/python2.7/dist-packages/pip/init.py”, line 61, in

from pip.vcs import git, mercurial, subversion, bazaar # noqa  

File “/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py”, line 9, in

from pip.download import path_to_url  

File “/usr/lib/python2.7/dist-packages/pip/download.py”, line 25, in

from requests.compat import IncompleteRead  

ImportError: cannot import name IncompleteRead

看原因应该是request库的问题,去launchpad一查,果然不止我一个:https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1306991。原因貌似是我的request库太新导致的。。。Orz

临时解决办法:手动备份删除/usr/lib/python2.7/dist-packages/下的requests和request-x.x.x.dist-info两个文件夹。

你可能感兴趣的:(ubuntu下pip出错的临时解决办法)