1. 程式人生 > 實用技巧 >sagemath 9.x 下的 jupyter 工作路徑設定

sagemath 9.x 下的 jupyter 工作路徑設定

因為 sagemath 預設開啟 jupyter notebook 是使用 虛擬 linux 環境的 Jupyter 進行的,所以它的工作路徑的設定的與windows下所有不同,

首先要找到它的配置檔案,當然你也可以在 sagemath shell 命令環境之下 通過命令先創造 jupyter配置檔案:

# 命令列輸入以下命令,生成預設配置檔案
jupyter notebook --generate-config

然後設定它的工作目錄 :

notebook_dir='...'

因為sagemath 是通過liunx環境進行的,所以它的根路徑是在sagemath安裝位置的

\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%