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 when I use any command I always get the same error (as an example using pip --upgrade
).
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip._internal import main
ImportError: No module named _internal
I have tried doing sudo apt-get remove python-pip
followed by sudo apt-get install python-pip
but nothing changed.
Thank you for your time!
This solution works for me:
or use sudo for elevated permissions (
sudo python3 get-pip.py --force-reinstall
).Of course, you can also use
python
instead ofpython3
;)Source
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.
Its probably due to a version conflict, try to run this, it will remove the older pip somehow.
Nothing worked for me, but only one thing: I used sudo in front of the command and it is working fine.
This command works for me.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py --force-reinstall --user
This did it for me:
Environment: OSX && Python installed via brew