I do not know what has happened because this used to work fine but I'm now experiencing a problem where I am running python2.7 but for some reason pip is installing in my python 3.5 dist-packages.
At least, I think this is the case based on when I type python -V
I get Python 2.7.10
and when I type pip -V
I get pip 8.1.2 from /usr/local/lib/python3.5/dist-packages (python 3.5)
This is causing me knock on problems when setting up virtualenv
etc. I've tried uninstalling and installing pip but it is still going back to 3.5. Could I have some advice please.
python-pip
andpython3-pip
(or both) do you have installed?sudo apt-get install pip
but I've just checked and I have the latest versions of both installedsudo apt-get remove python3-pip
but when I trypip -V
I get the same directory stillpip -V
I get-bash: /usr/local/bin/pip: /usr/bin/python3.5: bad interpreter: No such file or directory
but if I try to install pip I'm messaged it is already there. Obviously a path issue, but how do I change it?sudo apt-get install pip
in fact wouldn't work because there is no package namedpip
in the Ubuntu repositories. You probably meantsudo apt-get install python-pip
(for Python 2) orsudo apt-get install python3-pip
(for Python 3). Regardless, do you recall ever upgradingpip
? If so, how did you upgradepip
?