如何解决" ImportError:无法导入名称' HTTPSHandler'同时安装pip

时间:2016-10-24 03:57:16

标签: python python-3.x pip

尝试在没有root访问的ubuntu系统上安装pip失败,如下所示。

tcsh-334: wget https://bootstrap.pypa.io/get-pip.py
--2016-10-23 20:42:13--  https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.xx.175
Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|151.101.xx.175|:443...    connected.
HTTP request sent, awaiting response... 200 OK
Length: 1524722 (1.5M) [text/x-python]
Saving to: `get-pip.py'

100%[=================>] 1,524,722   1.70M/s   in 0.9s    

2016-10-23 20:42:15 (1.70 MB/s) - `get-pip.py' saved [1524722/1524722]

好了,现在让我们尝试运行它......这是发生错误的地方。

tcsh-335: python get-pip.py 
Traceback (most recent call last):
  File "get-pip.py", line 19177, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
  File "/tmp/tmpyi0bm3ms/pip.zip/pip/__init__.py", line 16, in <module>
  File "/tmp/tmpyi0bm3ms/pip.zip/pip/vcs/subversion.py", line 9, in <module>
  File "/tmp/tmpyi0bm3ms/pip.zip/pip/index.py", line 30, in <module>
  File "/tmp/tmpyi0bm3ms/pip.zip/pip/wheel.py", line 39, in <module>
  File "/tmp/tmpyi0bm3ms/pip.zip/pip/_vendor/distlib/scripts.py", line 14, in <module>
  File "/tmp/tmpyi0bm3ms/pip.zip/pip/_vendor/distlib/compat.py", line 66, in <module>
ImportError: cannot import name 'HTTPSHandler'

这里是我刚刚成功安装的python版本(使用--prefix到用户指定的位置。)

tcsh-336: which python
/volume/diags/python/bin/python

tcsh-337: python -V
Python 3.5.2

那么,我的问题是什么? ......或者我该如何解决这个问题?

0 个答案:

没有答案