Python 3.9 to 3.10 validation and cleanup

Yup. Nothing like a repo package anyway…
But that should have meant ythe directory was removed.
(on my system I have never removed an old python directory, like 2.7 etc)
So … it is possible something is relying on it …

you didnt …

Do that, for anything but list, right?
Do not use sudo with pip :pray:

So you have not removed 3.9 yet?
In any case … you can freely remove (through pip and/or manually deleting directories) old python version stuff or anything you dont want.



Now this is odd. I am inclined to say yes, as nothing owns it … but I still wonder why it exists.
(as noted above these directories usually are removed along with the python package)

1 Like

Ah, my mistake… I should have included the full commands I ran from the stable “wiki” post…

… so one of my commands was run with sudo as recommended

  • $ sudo pip freeze > pip_list_sudo.txt
  • $ pip freeze --user > pip_list_user.txt

That’s good news, I was hoping that was the case!

The only time I’ve experienced something like this (under Windows) was when a file was locked or in use or not part of the uninstall script… and usually folders refuse to delete so long as there are any files inside. But as you can see from the folder that the vast majority of the /usr/lib/python3.9 folder was removed… with the exception of one file that prevented its parent folders from being removed.

Honestly its just kinda silly to do that.
First because, again, users should not invoke sudo with pip. So there should be no ‘sudo pip’ packages.
But second because … that list will be largely useless because of listing all sorts of system packages that rely on python but are from the repos and not pip (example: ufw,gufw) …

The line afterwards …

Is downright dangerous.

I always appreciate your feedback @cscs . Being a relatively new to gnu/linux user still… I always make sure to post my questions if something looks questionable. Whether that be a command or the end result of a command.

But as the commands I ran were just generating lists, I wasn’t too concerned about them as it was my intention to follow one sage piece of advise…

… i.e. no plan to run sudo pip install -r pip_list_sudo.txt in my case.

The instruction there really should be avoided. Only the ‘user’ list should be needed or used.
And then only if you want those python packages.

I am currently trying to get the announcement ‘wiki’ section revised…


Broke my system following this piece of advice in the Announcement post.

Yikes! do you feel it was the “reinstall” via sudo pip install -r pip_list_sudo.txt that broke things for you @Kevin77 ?

In any case, you might want to add a warning in the stable thread for others.

I would expect it to break things.:persevere: Should be fixed now.

1 Like

Its the only thing that could. And it has an almost certainty that it would.
Sorry to you @Kevin77

1 Like

Yes. Ha ha. No big deal. Timeshift to the rescue.

Not a problem. All is well and good now :+1:

1 Like

Okay… so just to circle back to my original question/resolution… I won’t miss anything listed (pre-update) via python 3.9 pip freeze --user > pip_list_user.txt so I can feel good about $ rm -rdv /home/<userid>/.local/lib/python3.9?

And although it’s odd one file was left in /usr/lib/python3.9… I can remedy that with $ sudo rm -rdv /urs/lib/python3.9?

that’s a really positive attitude :beers: i switched to testing branch 2 days ago so i had got this update but came to know about this pip stuff just know (missed the testing announcement earlier). i have no aur package that uses python. the system python packages were automatically upgraded and i manually upgraded the ones installed via pip. important thing is nothing is broken (yet) :wink:

1 Like

All Stable and Testing Announcement threads with similar entries have been edited. :safety_vest:


the question about ‘pip’ results was raised in testing

I thought I’d share what I’ve written down about my understanding of the whole python update/readiness process… but as I wasn’t able to figure out how to upload an ODT/PDF, maybe a screenshot would be appreciated.

Major Python Version Updates.odt

Note: Click the image once to open in an “image box”, then optionally click once more to maximize for optimal reading

1 Like

The next line said words to the effect of “do not do it”.

I’m not sure who “they” is, but the capture of what was written was a “before you do” consideration, not “do not do” warning…

I agree it was definitely a statement to make one stop and think… but I wouldn’t like it to a cautionary tale about dangers ahead.

Thankfully I didn’t execute that command :wink: and now that the wiki posts have been updated others shouldn’t be tempted to run it going forward either

Thats not really what that line says. Its closer to saying ‘do this but with caution’.
Thing is … there is no real case for doing that … it only produces false results and then 'sudo pip install’s everything on that list - which would be bad for any pip package on any day, but even worse now that you would be attempting to overwrite repo packages as well.
sudo pip may make sense only in the case that someone properly set up a virtual environment.
But that wasnt mentioned anywhere in those instructions so I have to conclude it was simply written out of a fundamental misunderstanding.
Ultimately those notes should not have been added in that form at all.

not sure who “they” is

The pip documentation, for one.

As for “the next line”, I should have said “the next few lines”.
Depends when/where it was copied from my original version;
I did strengthen the “don’t do it” message later on, IIRC.

I wrote it in the 2021-12-28 testing announcement, and expected problems to be picked up there.
Was working it out for myself, as I thought I might have installed some in system python by mistake.

Later in the process I found that pip freeze picks up packages that pip did not install, as you can read here

Years ago I followed the advice on and many other places, simply “pip install package”, which must be intended for Windows users, as it fails in Linux with a permission error. When it failed I simply used sudo, didn’t know it was dangerous. And last week I was forgetting that there had been malware on PyPI.

And here I leave this…