Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named 'pip._vendor.cachecontrol'

Tags:

python

macos

pip

Running pip on OSX gives the following error:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==6.0.6', 'console_scripts', 'pip')()
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 519, in load_entry_point
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2630, in load_entry_point
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2310, in load
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2316, in resolve
  File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/__init__.py", line 15, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/vcs/mercurial.py", line 11, in <module>
    from pip.download import path_to_url
  File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/download.py", line 36, in <module>
    from pip._vendor.cachecontrol import CacheControlAdapter
  File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/_vendor/__init__.py", line 81, in load_module
    raise ImportError("No module named '%s'" % (name,))
ImportError: No module named 'pip._vendor.cachecontrol'

Any idea what am I doing wrong?

like image 356
user1056864 Avatar asked Jan 22 '15 00:01

user1056864


1 Answers

Not specific to OSX, but for those of you dealing with this issue now that Python 3.8.0 is on most stable repositories, this might be because you held back a package while updating your packages for compatibility reasons, or deleted a required package.

In my case, I had deleted the msgpack package and planned to reinstall it to fix another issue, but after the deletion of said package, I couldn't reinstall it through pip.

The solution was to (re)install python-msgpack.

i.e. for Arch's default package manager:

sudo pacman -Sy python-msgpack
like image 69
TwiN Avatar answered Oct 12 '22 14:10

TwiN