jupyterlab:
- pip:
pip install jupyter jupyterlab
- remote access:
- 生成配置文件:
jupyter notebook --generate-config
- 生成口令,訪問時輸入驗證:
>>>from notebook.auth import passwd
>>>passwd()
- 修改配置文件:
$vim ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip='*' # 就是設置所有ip皆可訪問
c.NotebookApp.password = 'sha1:72... # 剛才復制的那個密文'
c.NotebookApp.open_browser = False # 禁止自動打開瀏覽器
c.NotebookApp.port =8888 #隨便指定一個端口
- 訪問:瀏覽器輸入url: http://ip:port/
jupyter notebook調出快捷鍵:
- 方法1:在命令模式下,按鍵盤上 h 鍵。
- 方法2:在界面“Help”菜單下,點擊“Keyboard Shortcuts”。
jupyter常見問題:
- jupyter突然奔潰,重新打開,發現之前執行的文件全部丟失,文件恢復到了很久之前的版本
- 解決方案:
%history -g -f notebook_file.ipynb # 將所有執行歷史保存到文件notebook_file.ipynb文件中
https://blog.softhints.com/6-ways-recover-deleted-jupyter-notebook-including-jupyterlab/#step4jupyternotebookrestorecheckpointsession
- jupyter內核修改,官方手冊:
- 注意是否是conda環境
- 安裝ipykernel:
python -m pip install ipykernel
- 新建kernel:
python -m ipykernel install --user --name=py39
, 如果不定義--name參數的話,默認為python3
- 查看kernel:
jupyter kernelspec list
- 刪除:
jupyter kernelspec uninstall your_kernel_name