Python on Linux - Install/uninstall/reinstall

avanturismo

Member
Joined
Dec 27, 2021
Messages
35
Reaction score
8
Credits
248
Dear Linux community

I'm trying to uninstall previously installed python3
after uninstall process I'm checking in terminal for python version (in case its not uninstalled)
```$ python3 --version```
Please see screen attached

I'm not sure if its properly uninstalled

what does it means on the screen - goroutine 6 [running] ?
it is uninstalled? if yes what is the right way to install it again?

btw Im using latest Ubuntu

In advance I would like to thank you for Your attention and being so helpful for random noobs like me
 

Attachments

  • Screenshot from 2022-01-23 14-21-16.png
    Screenshot from 2022-01-23 14-21-16.png
    59.7 KB · Views: 466


I don't think you can uninstall python the way you think. A lot of applications, if not all, are so deeply dependent on it that you'd have to uninstall everything in order to remove it. I tried to uninstall python once and after the cry for the 15th dependency I gave up.
 
Attempting to remove Python is not a good idea. Python is installed by default on most Linux distributions and is used by various system scripts. And it may even be used by several applications that are installed on your system too.

Also Python2 is EOL, so Python3 is the default Python on an increasing number of distros.

By removing Python3, you could completely bork your install!
 
Installing, upgrading and uninstalling Python is especially problematic on Linux, because many of the administration tools of most of the distributions are written in Python, and sometimes, when you try to unistall it, "things can happen" like, for example, uninstall most of Gnome Desktop Environment.

For what is worth, in your case it seems you have installed Python 3.9 under your home folder. If that is so, what I would do is:

1. Back up all your files, just in case everthing fails and you need to reinstall the system
2. Dump your environment variables to see what python is declared in your environment:
Code:
set | grep ython
3. See where is the system python pointing:
Code:
ls -l $(which python)
If you don't see any trouble, meaning that nothing is pointing to /home/master/Python-3.9, then just remove that folder.

Going forward, I strongly recommend using virtual environments and using one of them for each project, without ever fiddling with the system installation of Python under any circumstance.
 
Dear Linux community

I'm trying to uninstall previously installed python3
after uninstall process I'm checking in terminal for python version (in case its not uninstalled)
```$ python3 --version```
Please see screen attached

I'm not sure if its properly uninstalled

what does it means on the screen - goroutine 6 [running] ?
it is uninstalled? if yes what is the right way to install it again?

btw Im using latest Ubuntu

In advance I would like to thank you for Your attention and being so helpful for random noobs like me
Best to leave it as some software are dependent on it.
 
thank You so much for Your answers. however I did uninstall before I read Your answers. now Im having looping log in screen with "Authentication error"

please advice the silly noob;(
:facepalm:
 
The uninstall operation most like would have removed one or more PAM (authentication modules).

If someone else knows that system so well to recommend an actual fix (I don't), pease do. Otherwise my best advise in terms of time v. benefits is to boot your computer with a Live distribution on a USB drive, mount your fixed drive partitions to rescue your data, and reinstall your system.
 
well shit happens... I dont have much important files on this computer however that will be good experience not to play around... still any advices?
 
well shit happens... I dont have much important files on this computer however that will be good experience not to play around... still any advices?
just reinstall the python3 version you uninstalled
 
Huh... It appears that I never hit send on my comment.

My comment was asking if this was the default Python you were trying to uninstall - but I see others have gotten there ahead of me. Darn me and my not hitting the submit button!

I've said this a couple times on this forum. I'll probably say it again.

DO NOT REMOVE THE DEFAULT PYTHON. YOU WILL BREAK THINGS.

Frankly, I wouldn't even try to fix it. I'd restore from backup or use a live USB to recover my data and do a nice clean install.

If you need a different version of Python than the default, install the different Python alongside the default Python. That's really the only way.
 
Huh... It appears that I never hit send on my comment.

My comment was asking if this was the default Python you were trying to uninstall - but I see others have gotten there ahead of me. Darn me and my not hitting the submit button!

I've said this a couple times on this forum. I'll probably say it again.

DO NOT REMOVE THE DEFAULT PYTHON. YOU WILL BREAK THINGS.

Frankly, I wouldn't even try to fix it. I'd restore from backup or use a live USB to recover my data and do a nice clean install.

If you need a different version of Python than the default, install the different Python alongside the default Python. That's really the only way.
well, this is how we learn :) very sad but luckly I dont have anything very important on that computer. But setting everything from the beginning will be pain in the ass...
 
well, this is how we learn :) very sad but luckly I dont have anything very important on that computer. But setting everything from the beginning will be pain in the ass...
Just reinstall it, it won't take long to get set back up.
 
well ok I will reinstall, but cant backup my data right?

is it matters if I use SD card instead of USB?
 
restarting PC end ups here...
 

Attachments

  • photo_2022-01-23_18-36-25.jpg
    photo_2022-01-23_18-36-25.jpg
    31.1 KB · Views: 314

Members online


Top