由于服務器安裝的miniconda3,無jupyter notebook,所以手工安裝jupyter notebook
1 先conda 安裝相關包
在base 環境下
conda install ipython
conda install jupyter notebook
2 生成配置文件
jupyter notebook --generate-config
Writing default config to: /home/***/.jupyter/jupyter_notebook_config.py
3 生成密碼
此處不再配置字體
然后配置網絡訪問的密碼
jupyter notebook password
Enter password:
Verify password:
[JupyterPasswordApp] Wrote hashed password to /home/***/.jupyter/jupyter_server_config.json
打開上述文件,獲取密文密碼
? {
?? ?"IdentityProvider": {
?? ? ?"hashed_password": "argon2:$argon2id$v=19$m=10240,t=10,p=8***"
? ? ?}
??}
然后打開/home/***/.jupyter/jupyter_notebook_config.py
配置密碼也可以python 腳本執行
輸入python進入python腳本
from notebook.auth import passwd
passwd()
Enter password
Verify password
從而得到密碼,兩者方式是一樣的
4 修改配置文件
/home/***/.jupyter/jupyter_notebook_config.py 修改如下配置
c.ServerApp.notebook_dir = '/' #設置啟動目錄為根目錄
?c.ServerApp.ip = '*' #代表本機上的所有IP地址
c.ServerApp.open_browser = True? #設置瀏覽器打開
c.ServerApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8***' #密碼
c.ServerApp.password_required = True #打開是需要密碼
?c.ServerApp.port = 15290 #15290是端口
?
5 開啟服務并驗證
服務器上輸入jupyter notebook
然后輸入對應的IP地址和端口
輸入密碼后登錄?
參考文獻:
1?miniconda安裝jupyter notebook及初始配置_miniconda 安裝jupyternotebook-CSDN博客
2?https://www.cnblogs.com/pychina/articles/12122710.html
3?https://www.cnblogs.com/catting123/p/16557462.html
4?[1026]設置 jupyter notebook 外網遠程訪問_jupyter notebook 允許外面的-CSDN博客
5?在個人PC上搭建jupyter服務并配置遠程訪問_jupyter 局域網訪問-CSDN博客