Linux安装Jupyter | Jupyter lab
一、Jupyter
1 生成配置文件
jupyter notebook --generate-config
2 设置密码#1
jupyter notebook password
2 设置密码#2
from notebook.auth import passwd
passwd()
Enter password: #输入密码
Verify password: #再次输入
‘sha1:f6800f579fba:149b24247b43e82e36da3d9323e6c6a90a5f0a0f’
3 复制密文
vim ~/.jupyter/jupyter_notebook_config.json
sha1:572869f2171b:f3d9d07ff773c02bdc1e95ce413a9b281c2882e2::
4 修改配置文件
vim ~/.jupyter/jupyter_notebook_config.py
添加如下内容
c.NotebookApp.ip='*' #设置所有ip皆可访问
c.NotebookApp.password = u'sha1:572869f2171b:f3d9d07ff773c02bdc1e95ce413a9b281c2882e2::' #刚才复制的密文
c.NotebookApp.open_browser = False #禁止自动打开浏览器
c.NotebookApp.port =8080 #随便指定一个端口
c.NotebookApp.notebook_dir = '/home/project' #指定目录
5 启动服务
jupyter notebook
直接启动
jupyter notebook --ip=0.0.0.0 --port=8080
复制token
输入token,login in
二、Jupyter lab
1 安装
conda install -c conda-forge jupyterlab
# pip install jupyterlab
2 启动服务
jupyter lab --ip=0.0.0.0 --port=8080
jupyter notebook --ip=0.0.0.0 --port=8080 --allow-root