1、下载jupyterlab
pip install jupyterlab
2.1配置jupyter_notebook_config.py
#生成配置文件
jupyter notebook --generate-config
Writing default config to: /home/pchoy/.jupyter/jupyter_notebook_config.py
2.2 修改配置文件
1)创建一个访问密码,后面需要、通过网页登陆时也需要
jupyter notebook password
Enter password: ****
Verify password: ****
2)获取hash密码
python
from notebook.auth import passwd
passwd()
Enter password:
Verify password:
Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
3)修改配置文件
vim /root/.jupyter/jupyter_notebook_config.py
#配置密码(这个非必要,之后会解释)
c.NotebookApp.password=u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
# 修改端口非必须
c.NotebookApp.port = 9999
#允许远程访问
c.NotebookApp.allow_remote_access = True
#允许所有IP访问
c.NotebookApp.ip='*'
#不使用本地浏览器打开
c.NotebookApp.open_browser = False
保存退出。
2.3 允许root启动
vim /root/.jupyter/jupyter_notebook_config.py
#找到这一行
#c.NotebookApp.allow_root = False
修改为
c.NotebookApp.allow_root = True
保存退出
2.4 重启jupyter lab
jupyter lab --port=8888
#挂起来
nohup jupyter lab --port=8888 &
一些问题
1、如果jupyter lab启动以后没有kernel,可能是python版本问题
莫用3.6.0 可以使用3.6.1或者更高版本