首先输入,查看配置文件位置
[as-pc as]# jupyter notebook --generate-config --allow-root
Overwrite /root/.jupyter/jupyter_notebook_config.py with default config? [y/N]y
Writing default config to: /root/.jupyter/jupyter_notebook_config.py
1
2
3
4
接下来打开配置文件
gedit /root/.jupyter/jupyter_notebook_config.py
1
找到这一行
#c.NotebookApp.allow_root = False
1
去掉#,并修改成True即可解决root权限运行的问题
c.NotebookApp.allow_root =True
1
保存,重新运行程序
jupyter notebook
1
设置访问密码
打开 ipython 输入
from notebook.auth import passwd
passwd()
1
2
然后根据提示输入2次密码
Enter password: ········
Verify password: ········
然后复制 ‘sha1:f5643****************************’ 粘贴至配置文件(记得去掉 #)
c.NotebookApp.password = u’sha1:f5*****************************’
1
更多设置如下
c.NotebookApp.ip = ‘localhost’
c.NotebookApp.open_browser = True(True:启动时自动打开浏览器,False:需手动打开浏览器访问http://localhost:8888/tree)
c.NotebookApp.port = 8888(端口设置)
作者:小小蒲公英
来源:优快云
原文:https://blog.youkuaiyun.com/weixin_39777626/article/details/80371659
版权声明:本文为博主原创文章,转载请附上博文链接!