运行 pip 时出现“无法导入名称 IncompleteRead”错误

运行 pip 时出现“无法导入名称 IncompleteRead”错误

当我安装 python-pip 时,它显示已安装,但是当我使用pip命令时,显示以下错误:

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    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 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
    from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead

答案1

看来此操作系统附带的版本已过时pip。一般来说,如果您仍然遇到此问题,则意味着您可能应该找到更新更频繁的发行版。

您可以尝试获取不带以下内容的较新版本apt

sudo apt-get remove python-pip
sudo apt-get install python-setuptools
sudo easy_install pip

其他解决方案已发布这里

相关内容