jupyter notebook --generate-config
ipython
$>ipython
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Out[2]: ‘sha1:0954d63f1d38:220c9f842e2b884cd9d0af8d2198caab9a*****’ #这个秘钥要copy备用
vim ~/.jupyter/jupyter_notebook_config.py
可以使用 :/要查找的单词
编辑刚才生成的配置文件修改以下:
c.NotebookApp.ip = ‘0.0.0.0’ # 对外提供访问的ip
c.NotebookApp.port = 8888 # 对外提供访问的端口
c.NotebookApp.open_browser = False # 启动不打开浏览器
c.NotebookApp.password = ‘sha1:0954d63f1d38:220c9f842e2b884cd9d0af8d2198caab9a*****’ # 上面生成的秘钥
c.NotebookApp.notebook_dir = u’自定义’ # 设置jupyter启动后默认文件夹
c.NotebookApp.allow_root = True # 允许root用户执行
启动jupyter notebook
后台运行:nohup jupyter notebook > /home/目录/jupyter.log 2>&1 &
问题
1,vscode The Jupyter notebook server failed to launch in time
python path 要指定 pythonw.exe 不是python.exe
vscode file->perferences->settings,搜索python path
输入python程序目录下的,pythonw.exe
例如:
c:/目录/python38/pythonw.exe