sagemath 9.x 下的 jupyter 工作路径设置

因为 sagemath 默认打开 jupyter notebook 是使用 虚拟 linux 环境的 Jupyter 进行的,所以它的工作路径的设置的与windows下所有不同,

首先要找到它的配置文件,当然你也可以在 sagemath shell 命令环境之下 通过命令先创造 jupyter配置文件:

# 命令行输入以下命令,生成默认配置文件
jupyter notebook --generate-config

然后设置它的工作目录 :

notebook_dir='...'

因为sagemath 是通过liunx环境进行的,所以它的根路径是在sagemath安装位置的

%homepath%\AppData\Local\SageMath 9.1\runtime\

而jupyter的工作目录设置位置这里首先并不是 上方生成的 jupyter_notebook_config.py 文件

它是在:%homepath%\AppData\Local\SageMath 9.1\runtime\etc\fstab.d\<user> 

的文件下,这个文件名就是你的用户名,用记事本打开,修改里面的路径就可以了

e:\ /home/sage ntfs binary,posix=1,user,acl 0 0
none /tmp usertemp binary,posix=0 0 0

通常是上面这样,比如我把它设置成了 e盘根上,一开始,通常默认 在sagemath 9.1来说是 %homepath%

这个目录上的。

那么设置完这里以后, jupyter_notebook_config.py里设置其实只是作为一个相对路径合并到这里设置的路径的后面。

 

posted on 2020-08-21 10:51  ProjectDD  阅读(1067)  评论(0编辑  收藏  举报