Ask Your Question
1

How get openssl with python 3 for macOS Sage 9.2?

asked 2020-11-10 05:19:08 +0100

murraye gravatar image

updated 2020-11-10 08:16:20 +0100

FrédéricC gravatar image

I just installed the app version of Sage 9.2 under macOS Catalina (10.15.7), to replace Sage 9.1 which had been working perfectly.

Starting Sage 9.2 opens file:///Applications/SageMath-9.2.app/Contents/Resources/loading-page.html in Safari, but then it hangs. Viewing the log shows:

Traceback (most recent call last): File "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/sage/repl/ipython_kernel/install.py", line 307, in have_prerequisites from notebook.notebookapp import NotebookApp File "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/notebook/notebookapp.py", line 66, in <module> from tornado import httpserver File "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/tornado/httpserver.py", line 29, in <module> import ssl File "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/ssl.py", line 98, in <module> import _ssl # if we can't import it, let the error propagate ModuleNotFoundError: No module named '_ssl' ┌────────────────────────────────────────────────────────────────────┐ │ SageMath version 9.2, Release Date: 2020-10-24 │ │ Using Python 3.8.5. Type "help()" for help. │ └────────────────────────────────────────────────────────────────────┘ Please wait while the Sage Jupyter Notebook server starts...

The Jupyter notebook requires ssl, even if you do not use https. Install the openssl development packages in your system and then rebuild Python (sage -f python3).

What exactly do I do about openssl? I already have the MacPorts openssl @1.1.1h_0. My default python3 is from the Anaconda distribution, and I used the conda command to install openssl, and the Anaconda environment includes both openssl 1.1.1h and pyopenssl 19.1.0.

QUESTION: What more do I need to do, and how?

Is there some way that I need to install openssl into the sage environment, too, and if so, how?

Even if I take care of that, then how would I use the "sage -f python3 command": if I try to execute, e.g., "/Applications/SageMath-9.2.app/Contents/MacOS/sage --help", that tries again to start the server, but the openssl problem prevents it from opening -- which means that once I did (somehow) get the openssl requirement satisfied, I don't know how to get the command "sage -f python3" to work. Seems like a "Catch 22"!

I never had any openssl problem with Sage 9.1 (or earlier versions, either).

edit retag flag offensive close merge delete

Comments

It seems that Jupyter now requires ssl, see https://groups.google.com/g/sage-deve...

Sébastien gravatar imageSébastien ( 2020-11-10 08:46:38 +0100 )edit

I have the exact same issue as all MacOS user should have when using the binaries of SageMath 9.2 downloaded directly from the web. I also did not have the issue with SageMath 9.1. I believe this has to do with SageMath using its own distributed Python 3.8 setup, which for some reason does not include openssl any more (I guess the binaries of SageMath 9.1 did). This practically makes the binaries provided on the website useless for all MacOS users.

The3DWizard gravatar imageThe3DWizard ( 2020-11-10 13:07:16 +0100 )edit

I guess the binaries of SageMath 9.1 did

No, ssl was never part of sagemath by default due to licencing issues, see https://ask.sagemath.org/question/51130/ which explains why and how to install openssl in order to activate sage -pip. The difference with sagemath-9.2 seems to be that jupyter now also depends on openssl (which was not the case before).

Sébastien gravatar imageSébastien ( 2020-11-10 22:47:27 +0100 )edit

A possible alternative to installing the sagemath binary for osx is to use conda apparently, see: https://groups.google.com/g/sage-deve...

Sébastien gravatar imageSébastien ( 2020-11-10 22:50:58 +0100 )edit

Thanks for the links and the clarification, very helpful.

The3DWizard gravatar imageThe3DWizard ( 2020-11-12 01:13:50 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-01-01 17:38:28 +0100

slelievre gravatar image

updated 2021-03-18 23:57:38 +0100

Use the fix_mac_sage script.

Or use the new app from

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-11-10 05:19:08 +0100

Seen: 1,589 times

Last updated: Mar 18 '21