guagay_wk
guagay_wk

Reputation: 28090

pip stopped working after upgrading anaconda v4.4 to v5.0

I ran the command conda update anaconda to update anaconda v4.4 to v5.0

After anaconda was successfully upgraded to v5.0, I had problems running pip.

This is the error output I see after running pip;

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\Scripts\pip-script.py", line 6, in <module>
    from pip import main
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\__init__.py", line 28, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\vcs\mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\download.py", line 41, in <module>
    from pip._vendor.requests.adapters import BaseAdapter, HTTPAdapter
ModuleNotFoundError: No module named 'pip._vendor.requests.adapters'

How can I get pip to work again? I am using Windows10, 64-bit python v3.6 anaconda v5.0

Upvotes: 6

Views: 7226

Answers (3)

Mahmoud Elagdar
Mahmoud Elagdar

Reputation: 880

Had the same problem fixed by renaming the directory:
%USERPROFILE%\Anaconda3\Lib\site-packages\pip

then running conda install --force-reinstall pip

(Then I guess it's safe to remove the renamed directory)

Upvotes: 19

Akash Desai
Akash Desai

Reputation: 518

This occurs when broken pip. The broken pip caused by the failed upgrade can be fixed by running:

!easy_install pip

Upvotes: 2

guagay_wk
guagay_wk

Reputation: 28090

I will answer my own question.

The problem was fixed by uninstalling anaconda and doing a fresh re-install from the windows installation executable.

Based on this link https://github.com/pypa/pip/issues/2345, it seems something went wrong with the installation but the problem cannot be reproduced. I do not know what exactly what wrong with conda update anaconda.

Upvotes: 0

Related Questions