Saf*_*sha 6 python macos sage jupyter-notebook
我SageMath-9.2在我的 mac 上下载,但每次我尝试使用笔记本时
通过sage -n jupyter在我的终端上运行“ ”
我得到以下按摩:
Please wait while the Sage Jupyter Notebook server starts...
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
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
import ssl
File "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/ssl.py", line 98, in
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'
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).
Run Code Online (Sandbox Code Playgroud)
而且由于某种原因我也无法打开该应用程序......每次我点击该应用程序时,我都会看到一个小窗口:
Jupyter Server failed to start
For some reason the Jupyter server failed to start. Please check the log for clues, and have that information handy when asking for help.
Run Code Online (Sandbox Code Playgroud)
我希望得到一些帮助,这对我来说非常重要,因为我必须在我的大学项目中使用 SageMath .. 在此先感谢
在 macOS Big Sur 上,有多种安装 SageMath 的方法
Sage 也可以在线使用
您当前的安装是作为 macOS 应用程序下载的,该应用程序自带 Python,但缺少 SSL 模块(出于许可原因)。
要修复它:
brew install
配置结束时的建议$ DIR=/Applications/SageMath-9.2.app/Contents/Resources/sage
$ cd $DIR
$ git checkout develop
$ git pull origin develop --tags
$ MAKE='make -j8'
$ V=0
$ source .homebrew-build-env
$ make -s V=0 python3-clean
$ make -s V=0 configure
$ ./configure
$ make -s V=0
Run Code Online (Sandbox Code Playgroud)
解决问题的另一种方法是将 Sage 提供的 SageMath Jupyter 内核与系统范围的 Jupyter 一起使用(例如,通过 Homebrew 安装)。
这应该可以实现这个目标:
$ SAGE_LOCAL=`sage -c 'print(SAGE_LOCAL)'`
$ SAGE_KERNEL=$SAGE_LOCAL/share/jupyter/kernels/sagemath
$ KERNELS=$HOME/Library/Jupyter/kernels
$ ln -s $SAGE_KERNEL $KERNELS
Run Code Online (Sandbox Code Playgroud)