I have the latest version of pip 8.1.1 on my ubuntu 16. But I am not able to install any modules via pip as I get this error all the time.
File \"/usr/local/
if you have 2 versions of pip for example /usr/lib/pip
and /usr/local/lib/pip
belongs to python 2.6 and 2.7.
you can delete the /usr/lib/pip
and make a link pip=>/usr/local/lib/pip.
A bit late but if easy_install doesn't solve the issue, this worked fine for me:
$ vim /usr/local/bin/pip
Then run:
:%s/7\.1\.0/8\.1\.1/g
:wq
After a large upgrade in Mint -> 19, my system was a bit weird and I came across this problem too.
I checked the answer from @amangpt777 that may be the one to try
/usr/local/bin/pip # -> actually had a shebang calling python3
~/.local/bin/pip* # files were duplicated with the "sudo installed" /usr/local/bin/pip*
Running
sudo python get-pip.py # with script https://bootstrap.pypa.io/get-pip.py
sudo -H pip install setuptools
seem to solve the problem. I understand this as a problem with the root / user installation of python. Not sure if ananconda3 is also messing around with those scrips.
Just relink to resolve it. Find which python : ls -l /usr/local/bin/python
ln -sf /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/bin/pip /usr/local/bin/pip
Or reinstall pip: https://pip.pypa.io/en/stable/installing/