pip install jupyter notebook将jupyter notebook 加入环境变量
即将 /usr/local/bin 添加到环境变量
参考:Linux环境变量配置全攻略 - 悠悠i - 博客园
生成配置文件jupyter notebook --generate-config配置密码
# 进入Python from notebook.auth import passwd passwd() # 随后设置密码修改配置文件
vim /root/.jupyter/jupyter_notebook_config.py
编辑如下配置:
c.NotebookApp.password = '刚刚生成的密钥' c.NotebookApp.ip = '0.0.0.0' c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 c.NotebookApp.notebook_dir = 'xxx' # 工作目录
修改完毕之后按一下ESC,并输入:wq按回车退出
当前窗口运行jupyter notebook --allow-root后台运行
nohup jupyter notebook --allow-root >/dev/null 2>&1 &随系统启动
编辑/etc/rc.local文件:
vi /etc/rc.local
在文件里面添加启动代码如下:
nohup jupyter notebook --allow-root >/dev/null 2>&1 &



