尝试导入HTTPSHandler时出现错误

时间:2014-11-02 16:35:17

标签: python openssl pip homebrew

我刚做了一个brew upgrade,我的Python安装出了点问题。当我运行pip时,我得到:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 356, in load_entry_point
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2476, in load_entry_point
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2190, in load
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/__init__.py", line 10, in <module>
    from pip.util import get_installed_distributions, get_prog
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 18, in <module>
    from pip._vendor.distlib import version
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/distlib/version.py", line 14, in <module>
    from .compat import string_types
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/distlib/compat.py", line 31, in <module>
    from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler

This question谈到同样的错误,但Mac解决方案都是指我没有使用的virtualenv。我还尝试brew link --force openssl然后使用--with-brewed-openssl标志(每this Gist)重新安装Python,但这也不起作用。这可能与我的PYTHONPATH有关吗?以下是一些变量:

which pip
/usr/local/bin/pip
echo $PYTHONPATH
/usr/local/lib/python2.7/site-packages:/usr/local/lib/python2.7/site-packages:

0 个答案:

没有答案