Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Cannot uninstall pip (2.7) modules after update-alternatves

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
grayedfox
Posts: 9
Joined: 2017-10-23 23:37

Cannot uninstall pip (2.7) modules after update-alternatves

#1 Post by grayedfox »

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!

cronoik
Posts: 310
Joined: 2015-05-20 21:17

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

#2 Post by cronoik »

You could use the full path to run it (/usr/bin/pip2).
Have a nice day!

grayedfox
Posts: 9
Joined: 2017-10-23 23:37

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

#3 Post by grayedfox »

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)

cronoik
Posts: 310
Joined: 2015-05-20 21:17

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

#4 Post by cronoik »

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!

Post Reply