Jupyter Lab

初创建于: 2022-12-10 10:51

Jupyter Lab

安装必要包

pip install jupyterlab npm
# 或者
# 注意 conda 默认下载的 nodejs 可能会版本有点低
# 可能需要手动指定版本
conda install jupyterlab nodejs

生成密码

# 启动 ipython
from IPython.lib import passwd
>>> passwd()
Enter password:
Verify password:

Out[2]: 'sha1:fb10b*******:****************************************'
Out[2]: 'sha1:fb10b786c337:992763bd0600e2750173d1ae06226f0f579d66e5'

将上面输出的 'sha1:fb10b:*********************************' 复制下来。

生成配置文件

先生成默认配置文件:

jupyter lab --generate-config

默认配置文件在 ~/.jupyter/jupyter_lab_config.py.

将配置文件拷贝到当前目录,比如当前路径是 PATH:

mkdir -p $PATH/.jupyter
cp ~/.jupyter/jupyter_lab_config.py $PATH/.jupyter/jupyter_lab_config.py

修改其中的一些配置项:

c.ServerApp.ip = '0.0.0.0'
c.ServerApp.password = u'sha1:fb10b*******:****************************************'
c.LabServerApp.open_browser = False
c.ServerApp.port = 8888
c.ServerApp.allow_remote_access = True
posted @ 2023-01-09 23:25  昤昽  阅读(284)  评论(0编辑  收藏  举报