sagelite

92 views
Skip to first unread message

William Stein

unread,
Apr 22, 2026, 12:13:47 AM (5 days ago) Apr 22
to sage-devel
Hi Sage-Devel,

For a long time, by far the biggest problem with sagemath is that you can't just easily "pip install" it into standard Python environments.   There's now sagelite which is sage, but pip-installable, and packaged in a pypi friendly way, so it's not too big, and doesn't include extra executables like Singular/Maxima/etc. -- just the core extension modules and code.  There's a few minor changes, e.g., prefer sympy over maxima for integration. 


This currently supports python 3.12, 3.13 and 3.14 on x86_64 Linux.  

The sage binary wheel is about 175MB, and there's dependencies on other wheels like scipy, matplotlib, etc.  A clean install is just over 1GB unpacked, with all deps.
 
 -- William

Tobia...@gmx.de

unread,
Apr 22, 2026, 3:11:41 AM (5 days ago) Apr 22
to sage-devel
Awesome to see some progress in this direction!

To clarify, with "doesn't include extra executables" you mean that the end-user has to install those manually and then you get a fully working sage?

In https://github.com/sagemath/sage/pull/41415, I was working on building wheels for the sagemath pypi package. Would be nice if you could upstream your generic changes to the wheel building infrastructure.

Jaap Spies

unread,
Apr 22, 2026, 4:26:27 AM (5 days ago) Apr 22
to sage-...@googlegroups.com
On fedora core 43 I did:
jaap@peace:~/sage$ uv venv --no-project --python 3.12 .venv
source .venv/bin/activate
uv pip install sagelite
python -c "import sage.all"
sagelite-selftest
Using CPython 3.12.13 interpreter at: /usr/bin/python3.12
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
Resolved 74 packages in 936ms
Prepared 74 packages in 49.99s
Installed 74 packages in 79ms
+ alabaster==1.0.0
+ asttokens==3.0.1
+ babel==2.18.0
+ certifi==2026.2.25
+ charset-normalizer==3.4.7
+ comm==0.2.3
+ contourpy==1.3.3
+ conway-polynomials==0.10
+ cycler==0.12.1
+ cysignals==1.12.6
+ cython==3.2.4
+ debugpy==1.8.20
+ decorator==5.2.1
+ docutils==0.22.4
+ executing==2.2.1
+ fonttools==4.62.1
+ fpylll==0.6.4
+ gmpy2==2.3.0
+ idna==3.12
+ imagesize==2.0.0
+ ipykernel==7.2.0
+ ipython==9.12.0
+ ipython-pygments-lexers==1.1.1
+ ipywidgets==8.1.8
+ jedi==0.19.2
+ jinja2==3.1.6
+ jupyter-client==8.8.0
+ jupyter-core==5.9.1
+ jupyterlab-widgets==3.0.16
+ kiwisolver==1.5.0
+ markupsafe==3.0.3
+ matplotlib==3.10.8
+ matplotlib-inline==0.2.1
+ memory-allocator==0.2.0
+ mpmath==1.3.0
+ nest-asyncio==1.6.0
+ networkx==3.6.1
+ numpy==2.4.4
+ packaging==26.1
+ parso==0.8.6
+ pexpect==4.9.0
+ pillow==12.2.0
+ pkgconfig==1.6.0
+ platformdirs==4.9.6
+ pplpy==0.9.0
+ primecountpy==0.2.1
+ prompt-toolkit==3.0.52
+ psutil==7.2.2
+ ptyprocess==0.7.0
+ pure-eval==0.2.3
+ pygments==2.20.0
+ pyparsing==3.3.2
+ python-dateutil==2.9.0.post0
+ pyzmq==27.1.0
+ requests==2.33.1
+ roman-numerals==4.1.0
+ sagelite==10.9b9.post4
+ scipy==1.17.1
+ six==1.17.0
+ snowballstemmer==3.0.1
+ sphinx==9.1.0
+ sphinxcontrib-applehelp==2.0.0
+ sphinxcontrib-devhelp==2.0.0
+ sphinxcontrib-htmlhelp==2.1.0
+ sphinxcontrib-jsmath==1.0.1
+ sphinxcontrib-qthelp==2.0.0
+ sphinxcontrib-serializinghtml==2.0.0
+ stack-data==0.6.3
+ sympy==1.14.0
+ tornado==6.5.5
+ traitlets==5.14.3
+ urllib3==2.6.3
+ wcwidth==0.6.0
+ widgetsnbextension==4.0.15
checking import sage.all ... ok
checking integer factorization ... ok (2 * 1013)
checking symbolic integration ... ok (-cos(x))
checking modular symbols ... ok ((x - 3) * (x + 2) * (x^2 - 2) * (x^3 - 4*x - 2) * (x^6 + 3*x^5 - 2*x^4 - 8*x^3 + 2*x^2 + 4*x - 1) * (x^20 - 3*x^19 - 29*x^18 + 91*x^17
+ 338*x^16 - 1130*x^15 - 2023*x^14 + 7432*x^13 + 6558*x^12 - 28021*x^11 - 10909*x^10 + 61267*x^9 + 6954*x^8 - 74752*x^7 + 1407*x^6 + 46330*x^5 - 1087*x^4 - 12558*x^3
- 942*x^2 + 960*x + 148))
checking elliptic curve rank ... ok (1)

optional runtimes:
 Singular executable: present
 Maxima library mode: not available

Looks promising,
Jaap

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/sage-devel/d07dfbcd-27aa-40b7-8321-b1809dabd92fn%40googlegroups.com.

William Stein

unread,
Apr 22, 2026, 10:47:09 AM (5 days ago) Apr 22
to sage-...@googlegroups.com
On Wed, Apr 22, 2026 at 12:11 AM 'Tobia...@gmx.de' via sage-devel <sage-...@googlegroups.com> wrote:
Awesome to see some progress in this direction!

To clarify, with "doesn't include extra executables" you mean that the end-user has to install those manually and then you get a fully working sage?

Yes.   They could possibly all be installed via a recommended conda package...

There are a couple of defaults in Sage, e.g., depend on maxima by default, or print a bunch of warnings about singular not being installed on startup, which are changed in sagelite. This make more things work without reliance on external programs. 
 
In https://github.com/sagemath/sage/pull/41415, I was working on building wheels for the sagemath pypi package. Would be nice if you could upstream your generic changes to the wheel building infrastructure.

I'm keeping sagelite as a separate repo https://github.com/sagemathinc/sagelite and will periodically merge in upstream sage to it.   Anybody is welcome to anything there, but I don't personally have the time or interest to upstream anything.

 -- William
 

On Wednesday, April 22, 2026 at 6:13:47 AM UTC+2 wst...@gmail.com wrote:
Hi Sage-Devel,

For a long time, by far the biggest problem with sagemath is that you can't just easily "pip install" it into standard Python environments.   There's now sagelite which is sage, but pip-installable, and packaged in a pypi friendly way, so it's not too big, and doesn't include extra executables like Singular/Maxima/etc. -- just the core extension modules and code.  There's a few minor changes, e.g., prefer sympy over maxima for integration. 


This currently supports python 3.12, 3.13 and 3.14 on x86_64 Linux.  

The sage binary wheel is about 175MB, and there's dependencies on other wheels like scipy, matplotlib, etc.  A clean install is just over 1GB unpacked, with all deps.
 
 -- William

--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/XPFqMFq3Apw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/sage-devel/cdc35f35-e3b0-4697-a8eb-74e5f7e98fa8n%40googlegroups.com.


--

Best Regards,
William Stein

CEO, SageMath, Inc.
https://cocalc.com

William Stein

unread,
Apr 22, 2026, 1:41:37 PM (5 days ago) Apr 22
to sage-...@googlegroups.com
Hi,

-  building these wheels, pushing them to pypi, etc. is all completely automated via github actions.   

- ARM64 (aarch64) is now supported as well, so if you're using macos you can make a docker/podman container then install sagelite using pip.

- If you 'pip install sagelite', then you can: (1) use "import sage.all" in your python environment, and also (2) just run "sage" and it uses your python environment.

 -- William
Reply all
Reply to author
Forward
0 new messages