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
Nothing worked for me, but only one thing: I used sudo in front of the command and it is working fine.
I met the same error on Windows when I tried to install a package via pip3:
Traceback (most recent call last):
File "d:\anaconda\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\anaconda\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Anaconda\Scripts\pip3.6.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip._internal'
My python is installed via Anaconda. I solved this issue by reinstalling pip via conda:
conda install pip
After that, pip returns to normal.
my solution: first step like most other answer:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python2.7 get-pip.py --force-reinstall
second, add soft link
sudo ln -s /usr/local/bin/pip /usr/bin/pip
I tried the following command to solve the issue and it worked for me:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall
For me
python -m pip uninstall pip
solved the issue. Reference
(On windows) not sure why this was happening but I had my PYTHONPATH setup to point to c:\python27 where python was installed. in combination with virtualenv this produced the mentioned bug.
resolved by removing the PYTHONPATH env var all together