Cannot uninstall pip (2.7) modules after update-alternatves

Kernels & Hardware, configuring network, installing services

Cannot uninstall pip (2.7) modules after update-alternatves

Postby grayedfox » 2017-10-25 12:53

Hi all,

Aside from the obvious (switch back to using python2.7 as default) I was wondering if there is a way, while python3.5 is the default python (meaning pip and python point to the 3.5 installation) to uninstall python 2 packages?

I ask because python 2.7 can still be referenced:

Code: Select all
$ python2 --version
Python 2.7.13


However pip (meaning not pip3) cannot:
Code: Select all
$ pip2 --version
pip 9.0.1 from ~/.local/lib/python3.5/site-packages (python 3.5)
$ pip1 --version
bash: pip1: command not found
$ pip --version
pip 9.0.1 from ~/.local/lib/python3.5/site-packages (python 3.5)


It feels strange that pip2 would also reference python3.5 after using update-alternatives to change the system python.

Thanks in advance!
grayedfox
 
Posts: 9
Joined: 2017-10-23 23:37

Re: Cannot uninstall pip (2.7) modules after update-alternat

Postby cronoik » 2017-10-25 20:35

You could use the full path to run it (/usr/bin/pip2).
Have a nice day!
cronoik
 
Posts: 225
Joined: 2015-05-20 21:17

Re: Cannot uninstall pip (2.7) modules after update-alternat

Postby grayedfox » 2017-10-31 13:35

cronoik wrote:You could use the full path to run it (/usr/bin/pip2).


Thanks for the reply. I checked, and I don't have pip (for python 2.7) installed at "/home/grayedfox/.local/lib/python2.7/site-packages/" - which is strange - since it's there in "/home/grayedfox/.local/lib/python3.5/site-packages/pip".

So it seems switching to Python3.5 as the system default for python removes the ability to install packages for python2.7.

Bit of an oversight perhaps :S

EDIT: if anyone could confirm this is intended behaviour, that would be great (and I'll then mark the topic as solved)
grayedfox
 
Posts: 9
Joined: 2017-10-23 23:37

Re: Cannot uninstall pip (2.7) modules after update-alternat

Postby cronoik » 2017-10-31 15:37

grayedfox wrote:Thanks for the reply. I checked, and I don't have pip (for python 2.7) installed at "/home/grayedfox/.local/lib/python2.7/site-packages/"
Why did you checked that path? Are you sure that you have installed pip by your own and not by the package manager? When you have installed it with the package manager pip is at /usr/bin/pip2.
Have a nice day!
cronoik
 
Posts: 225
Joined: 2015-05-20 21:17


Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable