Running as root is not recommended. Use --allow-root to bypass.
1、首先查看配置文件位置,输入:# jupyter notebook --generate-config --allow-root
2、接下来打开配置文件:# gedit /root/.jupyter/jupyter_notebook_config.py
3、找到"#c.NotebookApp.allow_root = False ";去掉#,并修改成True即可解决root权限运行的问题
c.NotebookApp.allow_root =True
保存,重新运行程序: # jupyter notebook
4、设置访问密码
打开 ipython 输入
from notebook.auth import passwd
passwd()
然后根据提示输入2次密码
Enter password: ········
Verify password: ········
5、复制密码,粘贴至配置文件(记得去掉 #)
c.NotebookApp.password = u'sha1:f5*****************************'
6、更多设置:
c.NotebookApp.ip = ‘localhost’
c.NotebookApp.open_browser = True(True:启动时自动打开浏览器,False:需手动打开浏览器访问http://localhost:8888/tree)
c.NotebookApp.port = 8888(端口设置)