Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip doesn't work after upgrading to OS X Yosemite

After upgrading to Yosemite, my pip doesn't work anymore. If I issue a pip command, it will complain like this:

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/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/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/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/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

I have tried sudo easy_install -U pip but didn't work.

like image 330
clwen Avatar asked Oct 20 '14 04:10

clwen


1 Answers

It sounds like you're trying to run pip with a python version installed by homebrew

You may want to try getting your homebrow up and running again.

  • Maybe relinking all your installed kegs is enough (s. https://apple.stackexchange.com/a/125319)
  • Or you can try reinstalling python with brew reinstall python
like image 178
Jann Avatar answered Nov 04 '22 14:11

Jann