Running pip
or pip3
results with:
Traceback (most recent call last):
File "/home/myuser/.local/bin/pip", line 7, in <module>
from pip._internal import main
ImportError: No module named 'pip._internal'
I had issues with this, and uninstalled pip3, but when i try to install it again using
sudo apt-get -y install python3-pip
it does install, but then running pip or pip3 i get the same error.
#which pip3
/home/myuser/.local/bin/pip3
Best Answer
After upgrading
pip
(orpip3
, in this case) if the following occurs:Force a reinstall of pip:
Verify install:
Now
pip3 install <package>
andpip3 install --user <package>
(for user-level installs) will work correctly.There should never, ever be any reason you need to run pip in elevated mode.
(note: For Python 2.7, just replace
python
forpython3
, andpip
forpip3
)Had same problem on macOS as well, it's a common issue across platforms.