欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

docker container 里配置 jupyter lab

程序员文章站 2022-05-28 23:31:59
...

下载jupyter notebook

pip install jupyter notebook

配置远程访问jupyter

生成密码

ipython
from notebook.auth import passwd
passwd()

输完之后,设定一个密码,会生成一个sha1的秘钥会有如下的结果:

quit()

生成jupyter notebook的配置文件

jupyter notebook --generate-config

这时候会生成配置文件,在 ~/.jupyter/jupyter_notebook_config.py

修改配置文件

vim ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip='*'
# 目录
c.NotebookApp.notebook_dir = '/workspace'
# 上面生成的秘钥
c.NotebookApp.password = u'argon2:$argon2id$v=19$m=10240,t=10,p=8$B5b+4guljAwGmfDWR/Inmg$iWlSYIEQ+9ZxnibbUSsFJA'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8899

打开jupyter notebook

jupyter notebook --allow-root &