原文博主:01010101
一、windows下,打開命令行,重新生成一個jupyter配置文件
-
jupyter notebook --generate-config
二、修個配置文件
- 找到這個新生成的文件:Windows:
C:\Users\USERNAME\.jupyter\jupyter_notebook_config.py
- 搜索 NotebookApp.allow_password_change,改為:NotebookApp.allow_password_change=False ,去掉注釋
三、回到windows命令行,運行jupyter notebook password
-
C:\Windows\System32>jupyter notebook password Enter password: #鍵入密碼,不顯示的 Verify password: #再次重復鍵入密碼 [NotebookPasswordApp] Wrote hashed password to C:\Users\用戶\.jupyter\jupyter_notebook_config.json #密碼生成的一串sha1(即是 NotebookPasswordApp),寫入到這個文件
四、在 jupyter_notebook_config.py 配置文件中找到 “c.NotebookApp.password“,插入剛生成的那個密碼sha1,效果如下:去掉注釋
-
c.NotebookApp.password = 'NotebookPasswordApp'
五、重啟 Jupyter