I have a problem when I try to use pip in any way. I\'m using Ubuntu 16.04.4
I should say that I\'ve used it already, and I never had any problem, but starting today
These often comes from using pip to "update" system installed pip, and/or having multiple pip installs under user. My solution was to clean out the multiple installed pips under user, reinstall pip repo, then "pip install --user pip" as above.
See: https://github.com/pypa/pip/issues/5599 for an official complete discussion and fixes for the problem.
For completeness, I just encountered this problem with "Ubuntu latest" ... v18.04 ... and fixed it in this way:
python3 -m pip install --upgrade pip
(Notice that it was necessary to specify python3
since this references Python 3.6.9. The python
command on the same system references Python 2.7.17. Since this is apparently a system-wide installation it encountered a ["not sudo" ...] permission error, but it didn't matter because it was the wrong thing to do anyway. I was encountering the problem with pip3
.)
For the current user only:
easy_install --user pip
or
python -m pip install --upgrade --user pip
The second may give /usr/bin/python: No module named pip
Even if which pip
finds the module named pip.
In this case try the easy_install
In file "/usr/local/bin/pip" change from pip._internal import main
to from pip import main
This did it for me:
python -m pip install --upgrade pip
Environment: OSX && Python installed via brew
I have the same problem on my virtual environment after upgrade python installation from 3.6 to 3.7 but only on vent globally pip work fine, to solve it I deactivate and delete my virtual environment after recreate again and now is fine, on venv:
deactivate
rm -rvf venv
and after recreate the virtual environment. I use mac OS 10.11, and python 3