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