JupyterLab远程配置

Jupyter Lab

config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 生成 ~/.jupyter/jupyter_notebook_config.py
jupyter notebook --generate-config

jupyter notebook passwd

# 密码哈希值
from notebook.auth import passwd
passwd()

# 修改一些配置
c.NotebookApp.allow_remote_access=True  # 允许远程访问

c.NotebookApp.ip='*'  #设置访问的IP地址,*为所有

c.NotebookApp.open_browser=False  # 不自动ß启动浏览器

c.NotebookApp.password="sha1:3......."  #notebook登录密码的hash值

c.NotebookApp.port=8888 #  设置访问端口, 默认是8888 ,冲突的话需要修改

HTML输出

1
2
3
pip install ipywidgets widgetsnbextension pandas-profiling

jupyter nbextension enable --py widgetsnbextension

输出限制

Settings --> Advanced Settings Editor --> NoteBook --> User Preferences

1
2
3
{
"maxNumberOutputs": 0
}

VSCode加载

  • ssh 连接
  • jupyter 远程服务器