- 生成配置文件
jupyter lab --generate-config
- ipython生成哈希密码
ipython
Python 3.8.0 | packaged by conda-forge | (default, Nov 22 2019, 19:11:38)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.28.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from notebokk.auth import passwd
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-640ad120a9cc> in <module>
----> 1 from notebokk.auth import passwd
ModuleNotFoundError: No module named 'notebokk'
In [2]: from notebook.auth import passwd
In [3]: passwd()
Enter password:
Verify password:
Out[3]: 'argon2:$argon2id$v=19$m=10240,t=10,p=8$ei53/op19Ejcqle9cILbJQ$NL6BXtRAjqnCMEGN85AjHg'
In [4]: exit
3.写配置文件
c.NotebookApp.ip = '*' #接受的地址
c.NotebookApp.open_browser = False
c.NotebookApp.password = "sha1:96f950a1ab0d:4d534e759f05953bed4d3562b5a13dabcf7aafe6" # 生成的密码
c.NotebookApp.port = 8888
c.ContentsManager.root_dir = '~/' # 设置jupyter打开的默认文件夹
4.启动
jupyter lab --allow-root > jupyter.log 2>&1 &
或是在screen中启动