建議安裝anaconda,自帶python 和 jupyter lab
如果你已經在使用anaconda,并且也創建了虛擬環境,那么下面命令應當conda activate xxx 到在你的虛擬環境,
生成配置
jupyter lab --generate-config
默認的組態檔放在 "C:\Users\Administrator\.jupyter\jupyter_lab_config.py"
修改配置
c.ServerApp.allow_remote_access = True #設定允許遠程訪問 c.ServerApp.local_hostnames = ['192.168.1.xxx'] #設定主機名 c.ServerApp.root_dir = 'E:\\' #設定啟動后的jupyterlab的筆記檔案根目錄 c.ServerApp.token = 'ddf3b439292e0f0027e36fafa3f70df04bf79c98936cb7d4' # 設定token 方便vscode配置jupyter
外部訪問
外部瀏覽器訪問 : http://192.168.1.xxx:8888/lab?token=ddf3b439292e0f0027e36fafa3f70df04bf79c98936cb7d4
vscode配置
Ctrl+shift+P 打開命令輸入框
Jupyter: 創建新的空白jupyter 筆記本
Jupyter: 指定本地或著遠程Jupyter服務器的連接--現有--填入 http://192.168.1.xxx:8888/lab?token=ddf3b439292e0f0027e36fafa3f70df04bf79c98936cb7d4 然后右下角會提示重啟vscode,重啟后,就可以創建一個筆記本用了
啟動和停止jupyterlab
啟動
- cmd視窗 jupyter lab
- conda navagator 點擊 jupyter lab 的 Lunch按鈕
停止
- cmd視窗 jupyter-lab stop 8888
注意事項
要想讓修改后的組態檔正確加載,必須正確關閉jupyter lab,
正確關閉jupyter lab的方法: 瀏覽器網頁端---檔案---shutdown
所有的組態檔鍵值對,必須靠左定格寫
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/260871.html
標籤:其他
