1.windows下,打开命令行CMD窗口,重新生成一个jupyter配置文件,并给出了生成的文件位置
C:\Users\Administrator>jupyter notebook --generate-config
Writing default config to: C:\Users\Administrator\.jupyter\jupyter_notebook_conf
ig.py
2.找到这个新生成的配置文件进行修改:Windows: C:\Users\Administrator.jupyter\jupyter_notebook_config.py
3.在配置文件中搜索 NotebookApp.allow_password_change(记得去掉注释的#号),改为:
NotebookApp.allow_password_change=False
4.回到windows命令行,运行jupyter notebook password,设置明文密码XXXXXX,得到对应的Hash密码
C:\Users\Administrator>jupyter notebook password
Enter password: #写入密码,密码不会显示
Verify password: #确认密码,密码不会显示
[NotebookPasswordApp] Wrote hashed password to C:\Users\Administrator\.jupyter\j
upyter_notebook_config.json
5.根据生成的json文件位置找到对应的文件,得到对应的Hash密码:
{
"NotebookApp": {
"password": "sha1:86771e46cefe:0831673f3046271e38e083eb6b1f945666eec7f9"
}
}
6.在第2步jupyter_notebook_config.py配置文件中找到“c.NotebookApp.password“(要去掉#号),等于刚生成的那个Hash密码sha1
c.NotebookApp.password = "sha1:86771e46cefe:0831673f3046271e38e083eb6b1f945666eec7f9"
7.重启jupyter notebook ,输入明文密码XXXXXX即可登陆