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 pip.pypa.io 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.
I’m glad you were chiming in on the test branches @j77h. I’ve been watching all the branch discussions so I’d have a good sense of what was coming down the pike for Stable… and I started paying extra attention once the [Unstable Update] 2021-12-13 - Python 3.10 Rebuilds post was made because I had a feeling a significant change like that deserved more attention and forethought than just clicking “Apply” in the pamac GUI’s upgrade tab.
I only noticed because of this post (and then retroactively changed the testing posts back through early december) … I dont usually pay attention to release/update announcements, especially on Stable or Testing … and on Unstable we dont have the ‘common problems/fixes’ wiki thing.
Off topic, and only view the image if there is a good sense of humour and understanding that it’s meant to bring a smile in times of seemingly thankless efforts.
At my old job, I started getting sick of the proverbial “attaboy’s” that managers seemed to think we lived off of… so I started bringing some reality and humour to it by sharing the following image with my colleagues after we’d solve a tough problem… even in some cases where what we’d accomplished wasn’t really noticed by management.
Still baffles me that people use these features … especially for sensitive things.
Its sorta funny when a friend can easily log into your email account because you left your machine on … its worse when it is easy to dupe users … its even worse when it can be accomplished by a drive-by (simply visit a page that somehow has malicious code injected) without extra protections … which are of course the same users that store things that way, dont configure security, and wont notice a problem until its too late.
But we should be fair here - when it comes to installing packages … especially 3rd party ones … the user should consider what it is they are installing…
(If you cant decipher the install/application or trust the source … the only safe thing is dont install)
More or less what I learned with AUR packages… at least look at the PKGBUILD file to try get a sense of what it’s doing before installing. For example, if it looks like it’s going somewhere weird/unexpected to download some files, that’s a sign to abort.
Even more baffling is that “responsible” corporations offer them.
Have never allowed a browser to save anything for me, out of sheer precaution,
and didn’t know until now how easily they could have been stolen.
(I use KeePassXC with a strong password; hope it’s safe enough.)
Those exploits don’t need root access,
so even ‘pip install --user’ must be used with great care.
Note: If you find it useful to install python components via pip, it’s best to keep them in “user-space” (Home directory) by installing them via $ pip install --user <component> … this will keep the core python install happier/cleaner, and make it easier to keep track of what you’ve personally installed.
When Python gets a major update… like python 3.9 (old) => 3.10 (new)… there’s a few things to do:
run $ pip freeze --user > pip_list_user.txt to get a list of all “user” installed python components for the current (pre-upgrade) python (which should be similar to looking inside /home/<userid>/.local/lib/python3.9) (old)
Sometimes installing one component will install dependencies as well… to see these dependencies it can be useful to run $ pip show <component>. This could also help to shorten the “re-install” list inside pip_list_user.txt if the inter-dependencies are known.
running $ pacman -Qoq /usr/lib/python3.9 (old) will list many existing “system” (and AUR) packages that pacman|pamac (the upgrade) “should” re-install for the upgraded python version (i.e. python 3.9 => 3.10)
Option 1: If you want what’s in the pip_list_user.txt (old python 3.9) file to be installed under the new python 3.10, there are a few choices:
Reinstall them manually via $ pip install --user <component> (paying attention to dependencies to re-install with the least steps)
Look for an AUR/repo controlled component (removes reliance on pip)
Option 2: If you don’t want what’s in the pip_list_user.txt (old python 3.9) file to be installed under the new python 3.10, simply perform to the next “remove” step
Either path/option chosen above, you’ll also want to make sure to clear out the old 3.9 “user-space” via $ rm -rdv /home/<userid>/.local/lib/python3.9 (old)
running $ pacman -Qoq /usr/lib/python3.9 (old) should be empty… if it’s not, you may need to run the following command to update them (i.e. rebuilding AUR packages)…$ pamac build $(pacman -Qoq /usr/lib/python3.9) --no-confirm
It’s a good idea to check /user/lib/python3.9 (old) to make sure it was completely removed. Had it once where one “pycache” file prevented a directory tree from being removed… solved via $ sudo rm -rdv /usr/lib/python3.9 (old)
In response to misunderstandings of some users who know nothing about python or pip,
I have updated the wiki post in the stable update announcement, to the following.
(It’s rather long for the wiki post, maybe I’ll put it in another post and link to it…)
Original content removed because it has been greatly improved in the current version, which is here.
The way "python3.9 (old)" appears, I thought you had renamed that dir,
but seeing the backticks in the source I realize you didn’t.
It’s not necessary to remove the old ‘site-packages’ directories, they don’t do any harm.
After you’re sure you’ve got all the info you need out of them,
you can delete them, but the reason is only to save space.
Good point about seeing dependencies with ‘pip show’.
Manjaro/Arch could use a complete wiki article about this subject.
Took me a lot of hours to find out things like “‘pip freeze’ lists packages it didn’t install”,
as it’s not mentioned in the pip documentation (or it’s buried too deep).
I got familiar with Python long before I found Manjaro,
and I’m surprised at how many people know nothing about it.
(Same goes for SQL and database structure, which I knew before I learned Python.)
Not sure about that.
The requirements text contains version numbers, which are probably out of date by now.
It’s intended for replicating an installation exactly, but we’re upgrading, so it doesn’t seem to fit the situation.
People who need freeze will know about it already, I think.
Do you agree?
I’m making a new post that does not mention freeze at all (only list),
with the idea of linking to it from the update’s wiki-post…
Also, it won’t mention virtual environments,
as anyone who has gone through the process of learning how to set one up
will know how to take care of it, and for the others it will be meaningless cognitive overload.