對於一個jupyter編輯器使用的新手,更換瀏覽器或者Logout後,須要輸入密碼進行登錄時python
按照網上的教程怎麼設置都不行,那麼本身整理了一個適用於初學者的操做。json
1.windows下,打開命令行,從新生成一個jupyter配置文件:windows
jupyter notebook --generate-config
2.修個配置文件,找到這個新生成的文件:Windows: C:\Users\USERNAME\.jupyter\jupyter_notebook_config.py
瀏覽器
搜索 NotebookApp.allow_password_change,改成:NotebookApp.allow_password_change=False ,記得去掉註釋的#編輯器
3.回到windows命令行,運行jupyter notebook passwordspa
C:\Windows\System32>jupyter notebook password
Enter password: #鍵入密碼,不顯示的
Verify password: #再次重複鍵入密碼
[NotebookPasswordApp] Wrote hashed password to C:\Users\用戶\.jupyter\jupyter_notebook_config.json #密碼生成的一串sha1,寫入到了這個文件,等下要把這串sha1,複製到第一個生成的配置文件中
4.還差一步密碼才能夠生效使用,在第一個jupyter_notebook_config.py配置文件中找到「c.NotebookApp.password「,等於,剛生成的那個密碼sha1,效果以下:去掉前面的」#「命令行
c.NotebookApp.password = u'sha1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
5.保險起見,把jupyter重啓,以後,不管是更換瀏覽器仍是Logout登錄,新密碼均可以正常使用了。code
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡orm
第3步也能夠換成:ipython執行blog
C:\Windows\System32>ipython Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] Type 'copyright', 'credits' or 'license' for more information IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: from notebook.auth import passwd In [2]: passwd() Enter password: Verify password: Out[2]: 'sha1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'