sage-doc-html + urllib3 + openSSL problem when building from source on M4 Macbook

147 views
Skip to first unread message

Pavel Galashin

unread,
Jan 2, 2025, 11:27:48 PM1/2/25
to sage-s...@googlegroups.com
Hi,

I am running into the following problem when building Sage from source. It hangs while installing the package ``sagemath_doc_html-none``. It shows a warning about urllib3 incompatibility with OpenSSL 1.1.1+.

I am on an M4 Macbook Pro (2024), Mac OS Sequoia 15.2, using Homebrew Python 3.13.1.

Below is what appears in the log file, but the terminal actually hangs on the line

[spkg-install] warnings.warn(

[spkg-install] /Users/user/sage/sage/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
[spkg-install]   warnings.warn(
Setting up build directory /Users/user/sage/sage/local/var/tmp/sage/build/sagemath_doc_html-none
Host system: Darwin PG-Mac-2.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec  6 19:03:40 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6041 arm64
C compiler: gcc, Apple clang version 16.0.0 (clang-1600.0.26.6), Target: arm64-apple-darwin24.2.0, Thread model: posix, InstalledDir: /Library/Developer/CommandLineTools/usr/bin
No stamp file for package 'sagemath_doc_html' in /Users/user/sage/sage/local/var/lib/sage/installed
No spkg-legacy-uninstall script; nothing to do
[spkg-install] mkdir -p en/reference/repl
[spkg-install] sage -advanced > en/reference/repl/options.txt
[spkg-install] /Users/user/sage/sage/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
[spkg-install]   warnings.warn(
[spkg-install] make doc-inventory--reference-references
[spkg-install] sage --docbuild --no-pdf-links reference/references inventory 
[spkg-install] /Users/user/sage/sage/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
[spkg-install]   warnings.warn(
[spkg-install] [reference] Interrupting Mathematica...
[spkg-install] [reference] Interrupted!
[spkg-install] make[5]: *** [doc-inventory-reference] Interrupt: 2
************************************************************************
Error installing package sagemath_doc_html-none
************************************************************************
Please email sage-devel (http://groups.google.com/group/sage-devel)
explaining the problem and including the log files
  /Users/user/sage/sage/logs/pkgs/sagemath_doc_html-none.log
and
  /Users/user/sage/sage/config.log
Describe your computer, operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/Users/user/sage/sage/local/var/tmp/sage/build/sagemath_doc_html-none and type 'make' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
  (cd '/Users/user/sage/sage/local/var/tmp/sage/build/sagemath_doc_html-none' && '/Users/user/sage/sage/sage' --buildsh)
When you are done debugging, you can type "exit" to leave the subshell.

--
Best,
Pasha
sagemath_doc_html-none.log
config.log

Jackson Walters

unread,
Jan 2, 2025, 11:37:36 PM1/2/25
to sage-s...@googlegroups.com
I believe I had a similar (unresolved) problem:


Error building Sage.
The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):
* package:         sagemath_doc_html-none
  last build time: Dec 20 05:20
  log file:        /Users/jacksonwalters/Documents/GitHub/sage/logs/pkgs/sagemath_doc_html-none.log
  build directory: /Users/jacksonwalters/Documents/GitHub/sage/local/var/tmp/sage/build/sagemath_doc_html-none
It is safe to delete any log files and build directories, but they
contain information that is helpful for debugging build problems.
WARNING: If you now run 'make' again, the build directory of the
same version of the package will, by default, be deleted. Set the
environment variable SAGE_KEEP_BUILT_SPKGS=yes to prevent this.
real 67m11.097s user 127m23.853s sys 46m4.781s
make[1]: *** [all-start] Error 1
make: *** [all] Error 2

HTH,
Jackson

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/sage-support/CAFw1yAiL%3Dyw35%3DBCBtL0kASWUfUoXN2eGDZ7uGNx%3Ddg_a67HEA%40mail.gmail.com.

Dima Pasechnik

unread,
Jan 3, 2025, 1:02:22 AM1/3/25
to sage-support
/usr/bin/python3 you end up using is no good for using with Sage (and unfortunately our
./configure doesn't see it), that's why.

I suggested to install python3.12 in Homebrew and use it instead.
(because building Sage's python is broken on your macOS version, too,
there aren't many other
easy options)

Dima

John H Palmieri

unread,
Jan 3, 2025, 1:01:34 PM1/3/25
to sage-support
To expand on Dima's answer: Homebrew's Python 3.13 is too new to build Sage, so Sage will reject it. The built-in Python 3.9 is, as Dima says, no good for use with Sage. So install Homebrew's python 3.12, do "make distclean", and then use

   ./configure --with-python=" fill in path to python3.12 "

or you can do precisely this:

  ./configure --with-python=`which python3.12`

This should use Homebrew's Python 3.12 (assuming you've installed it) even if you've also installed newer versions with Homebrew. You can tell which version of Python is being used by the symlink "venv" in the top-level Sage directory:

% ls -l venv
lrwxr-xr-x  1 palmieri  staff  34 Dec 30 15:41 venv -> local/var/lib/sage/venv-python3.12

and also by the name of the directory starting "venv" in local/var/lib/sage/:

% ls local/var/lib/sage/              
installed       scripts         venv-python3.12

Pavel Galashin

unread,
Jan 7, 2025, 3:56:47 AM1/7/25
to sage-support
Thank you for the advice! I used python3.12 and the warning about urllib3 disappeared, but make still hangs (for > 12 hours) on the same package ``sagemath_doc_html-none``.

[sagemath_doc_html-none] Setting up build directory /Users/user/sage/sage/local/var/tmp/sage/build/sagemath_doc_html-none [sagemath_doc_html-none] Host system: Darwin PG-Mac-2.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 19:03:40 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6041 arm64 [sagemath_doc_html-none] C compiler: gcc, Apple clang version 16.0.0 (clang-1600.0.26.6), Target: arm64-apple-darwin24.2.0, Thread model: posix, InstalledDir: /Library/Developer/CommandLineTools/usr/bin [sagemath_doc_html-none] No stamp file for package 'sagemath_doc_html' in /Users/user/sage/sage/local/var/lib/sage/installed [sagemath_doc_html-none] No spkg-legacy-uninstall script; nothing to do [sagemath_doc_html-none] [spkg-install] mkdir -p en/reference/repl [sagemath_doc_html-none] [spkg-install] sage -advanced > en/reference/repl/options.txt [sagemath_doc_html-none] [spkg-install] make doc-inventory--reference-references [sagemath_doc_html-none] [spkg-install] sage --docbuild --no-pdf-links reference/references inventory ^Z [6]+ Stopped make
config.log
sagemath_doc_html-none.log

Dima Pasechnik

unread,
Jan 7, 2025, 11:13:14 AM1/7/25
to sage-support
Our docbuilder isn't great, it uses some custom outdated  tricks for
parallel building. Switching to a more standard sphinx setup is overdue...

Try cleaning docs by

make doc-clean

and then run

make -j1

Pavel Galashin

unread,
Jan 7, 2025, 11:52:57 AM1/7/25
to sage-support
That doesn't seem to help:

[sagemath_doc_html-none] Setting up build directory /Users/user/sage/sage/local/var/tmp/sage/build/sagemath_doc_html-none [sagemath_doc_html-none] Host system: Darwin PG-Mac-2.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 19:03:40 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6041 arm64 [sagemath_doc_html-none] C compiler: gcc, Apple clang version 16.0.0 (clang-1600.0.26.6), Target: arm64-apple-darwin24.2.0, Thread model: posix, InstalledDir: /Library/Developer/CommandLineTools/usr/bin [sagemath_doc_html-none] No stamp file for package 'sagemath_doc_html' in /Users/user/sage/sage/local/var/lib/sage/installed [sagemath_doc_html-none] No spkg-legacy-uninstall script; nothing to do [sagemath_doc_html-none] [spkg-install] mkdir -p en/reference/repl [sagemath_doc_html-none] [spkg-install] sage -advanced > en/reference/repl/options.txt [sagemath_doc_html-none] [spkg-install] make doc-inventory--reference-references [sagemath_doc_html-none] [spkg-install] sage --docbuild --no-pdf-links reference/references inventory
 

sagemath_doc_html-none.log:

Setting up build directory /Users/user/sage/sage/local/var/tmp/sage/build/sagemath_doc_html-none Host system: Darwin PG-Mac-2.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 19:03:40 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6041 arm64 C compiler: gcc, Apple clang version 16.0.0 (clang-1600.0.26.6), Target: arm64-apple-darwin24.2.0, Thread model: posix, InstalledDir: /Library/Developer/CommandLineTools/usr/bin No stamp file for package 'sagemath_doc_html' in /Users/user/sage/sage/local/var/lib/sage/installed No spkg-legacy-uninstall script; nothing to do [spkg-install] mkdir -p en/reference/repl [spkg-install] sage -advanced > en/reference/repl/options.txt [spkg-install] make doc-inventory--reference-references [spkg-install] sage --docbuild --no-pdf-links reference/references inventory Setting up build directory /Users/user/sage/sage/local/var/tmp/sage/build/sagemath_doc_html-none Host system: Darwin PG-Mac-2.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 19:03:40 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6041 arm64 C compiler: gcc, Apple clang version 16.0.0 (clang-1600.0.26.6), Target: arm64-apple-darwin24.2.0, Thread model: posix, InstalledDir: /Library/Developer/CommandLineTools/usr/bin No stamp file for package 'sagemath_doc_html' in /Users/user/sage/sage/local/var/lib/sage/installed No spkg-legacy-uninstall script; nothing to do [spkg-install] mkdir -p en/reference/repl [spkg-install] sage -advanced > en/reference/repl/options.txt [spkg-install] make doc-inventory--reference-references [spkg-install] sage --docbuild --no-pdf-links reference/references inventory

Pavel Galashin

unread,
Jan 9, 2025, 3:51:05 AM1/9/25
to sage-support
Huh, the problem got completely solved just by switching to Python 9! Thanks a lot for the help!

$ make distclean $ ./configure --with-python=`which python3.9` $ make -s V=0 -j1
...

[tzlocal-5.0.1] installing. Log file: /Users/user/sage/sage/logs/pkgs/tzlocal-5.0.1.log [tzlocal-5.0.1] successfully installed. Sage build/upgrade complete! real 101m19.420s user 96m41.546s sys 14m53.704s PG-Mac-2:sage user$ ./sage ┌────────────────────────────────────────────────────────────────────┐ │ SageMath version 10.6.beta3, Release Date: 2025-01-04 │ │ Using Python 3.9.21. Type "help()" for help. │ └────────────────────────────────────────────────────────────────────┘ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Warning: this is a prerelease version, and it may be unstable. ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ sage: sin(pi/3) 1/2*sqrt(3)

Dima Pasechnik

unread,
Jan 9, 2025, 10:59:39 AM1/9/25
to sage-support
Thanks. So, what's the output of

which python3.9
in your case? And where does it come from? I suppose the issue lies in multiptocessing/multithreading support  in Python, which eveloved a lot since 3.9.

More Pythons to try might be from https://www.python.org/downloads/ (it would be good to know which of these 3.9-3.12 work)

Pavel Galashin

unread,
Jan 9, 2025, 11:52:07 AM1/9/25
to sage-support
It was installed via homebrew, same as python3.12:
$ which python3.9 /opt/homebrew/bin/python3.9

Dima Pasechnik

unread,
Jan 9, 2025, 1:27:49 PM1/9/25
to sage-support
It would be great if you tried newer Homebrew Pythons, .i.e. 3.10 and 3.11, too, and reported here the results.

Pavel Galashin

unread,
Jan 11, 2025, 9:08:21 AM1/11/25
to sage-support
I ran the same commands from scratch in new folders:

$ git clone -c core.symlinks=true --filter blob:none \ --origin upstream --branch develop --tags \ https://github.com/sagemath/sage.git $ cd sage $ make configure $ source ./.homebrew-build-env $ ./configure --with-python=`which pythonX.X` $ make -s V=0 -j1

The results:
 - python3.9: works (as above)
 - python3.10: also works
 - python3.11: Error installing package scipy-1.12.0 (end of log file attached)
 - python3.12: hangs on installing sagemath_doc_html-none (as above); scipy-1.12.0 installed successfully.


scipy_log_python_3_11.log

Dima Pasechnik

unread,
Jan 11, 2025, 12:39:02 PM1/11/25
to sage-s...@googlegroups.com
On Sat, Jan 11, 2025 at 8:08 AM Pavel Galashin <pgal...@gmail.com> wrote:
>
> I ran the same commands from scratch in new folders:
>
> $ git clone -c core.symlinks=true --filter blob:none \ --origin upstream --branch develop --tags \ https://github.com/sagemath/sage.git $ cd sage $ make configure $ source ./.homebrew-build-env $ ./configure --with-python=`which pythonX.X` $ make -s V=0 -j1
>
> The results:
> - python3.9: works (as above)
> - python3.10: also works
> - python3.11: Error installing package scipy-1.12.0 (end of log file attached)
> - python3.12: hangs on installing sagemath_doc_html-none (as above); scipy-1.12.0 installed successfully.

Thanks! Regarding python3.11 - it could be just a random one-off
error, but in any even it does not look like
a Sage problem. Can you install scipy with python 3.11 without sage?
(Just make a venv, activate it, and follow the standard
scipy instructions to build from source. It would be good if you can
say whether 1.12.0 and the latest 1.15.1 are installable this way)
For the latest scipy it's just one command (assuming you're in an active venv)

pip install scipy --no-binary scipy
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/e3c7396c-c8a5-4c79-ad1f-05e5ae04982fn%40googlegroups.com.

Pavel Galashin

unread,
Jan 11, 2025, 1:16:49 PM1/11/25
to sage-support
Hmm. I decided my previous experiment was contaminated because I slightly messed up had to do ``make distclean`` a couple of times, so I created three clean folders and ran precisely the above commands and nothing else, and got a successful installation of sagemath for each of python3.10, python3.11, and python3.12! No idea what is going on. I'm guessing I may have forgotten to either ``make configure`` or ``source ./.homebrew-build-env`` in some of the cases, or added them after ``make distclean`` which somehow broke things.
Reply all
Reply to author
Forward
0 new messages