Removing packages and different versions of python

86 views
Skip to first unread message

Jean-Florent Raymond

unread,
Apr 15, 2022, 3:39:23 AM4/15/22
to sage-s...@googlegroups.com
Hello,

In order to test something I would like to remove from my sage install a
python package that I installed (and updated) some time ago.

First question:
How can I remove a package installed with "sage -i"? I found
instructions in the doc to install packages, but nothing to remove them.
Is "sage -i" the same as "sage -pip install" (and "pip install" in a
"sage -sh" session), so I can simply do "sage -pip uninstall"?

When checking if there remain some files named after this package after
the "sage -pip uninstall" command, I can see that the package is still
installed in:

sage/local/lib/python3.7/site-packages/<package name>
sage/local/lib/python3.9/site-packages/<package name>

I guess because I installed it when the python version of my sage
install was 3.7 or 3.9 (currently it is 3.10.3).
I don't think there is a reason to keep this, hence my second question :
how to remove this given that I don't have python3.7 or python3.9
anymore in sage-sh ? Can I just rm everything in
sage/local/lib/python3.7 and sage/local/lib/python3.9?

Last question: what does "spkg" mean :) ? Is it just any package that
can be installed to use with Sage, some of which are standard python
(pip-installable) packages and some with different install scripts?

Best,
Jean-Florent.

Matthias Koeppe

unread,
Apr 15, 2022, 2:00:33 PM4/15/22
to sage-support
On Friday, April 15, 2022 at 12:39:23 AM UTC-7 Jean-Florent Raymond wrote:
In order to test something I would like to remove from my sage install a
python package that I installed (and updated) some time ago.

First question:
How can I remove a package installed with "sage -i"? I found
instructions in the doc to install packages, but nothing to remove them.
Is "sage -i" the same as "sage -pip install" (and "pip install" in a
"sage -sh" session), so I can simply do "sage -pip uninstall"?

To uninstall a package SPKG, use either "make SPKG-clean" or "make SPKG-uninstall" - depending on the package source type (see https://doc.sagemath.org/html/en/developer/packaging.html#package-source-types). 
(We are in the process of unifying this - https://trac.sagemath.org/ticket/29097)

When checking if there remain some files named after this package after
the "sage -pip uninstall" command, I can see that the package is still
installed in:

sage/local/lib/python3.7/site-packages/<package name>
sage/local/lib/python3.9/site-packages/<package name>

I guess because I installed it when the python version of my sage
install was 3.7 or 3.9 (currently it is 3.10.3).
I don't think there is a reason to keep this, hence my second question :
how to remove this given that I don't have python3.7 or python3.9
anymore in sage-sh ? Can I just rm everything in
sage/local/lib/python3.7 and sage/local/lib/python3.9?

Yes, you can safely "rm" it.
 
Last question: what does "spkg" mean :) ?

I think it just means "Sage package".
 
Is it just any package that
can be installed to use with Sage, some of which are standard python
(pip-installable) packages and some with different install scripts?

Yes.

Jean-Florent Raymond

unread,
Apr 18, 2022, 4:28:27 PM4/18/22
to sage-s...@googlegroups.com
Thanks, that answers my questions!
Reply all
Reply to author
Forward
0 new messages