Python ImportError:在virtualenv中运行pip upgrade时无法导入名称HeaderParsingError

时间:2018-03-03 23:19:36

标签: python pip

在python虚拟环境中,我无法通过pip安装任何东西。

这是我运行的命令:

pip install --upgrade pip 

错误输出:

ImportError: cannot import name HeaderParsingError

整个追溯如下所示:

(env)root@ali-Lenovo-G50-80:/home/ali# pip install --upgrade pip
Traceback (most recent call last):
  File "/home/ali/env/bin/pip", line 7, in <module>
    from pip import main
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/__init__.py", line 11, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/download.py", line 22, in <module>
    from pip._vendor import requests, six
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/_vendor/requests/utils.py", line 25, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/_vendor/requests/compat.py", line 7, in <module>
    from .packages import chardet
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/__init__.py", line 3, in <module>
    from . import urllib3
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py", line 16, in <module>
    from .connectionpool import (
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 33, in <module>
    from .connection import (
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connection.py", line 41, in <module>
    from .util import (
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py", line 5, in <module>
    from .response import is_fp_closed
  File "/home/ali/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py", line 4, in <module>
    from ..exceptions import HeaderParsingError
ImportError: cannot import name HeaderParsingError

请帮忙吗?

0 个答案:

没有答案