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
配置Jupyter Notebook远程访问及后台运行
本文指导如何配置Jupyter Notebook以允许远程访问和后台运行。首先,通过`ipython`命令生成密码,然后在`jupyter_notebook_config.py`配置文件中设置IP、端口、密码和默认工作目录。确保开启root用户执行权限。最后,通过`nohup`命令后台启动Jupyter Notebook,并指定日志输出位置。同时提到了VSCode中配置Python路径应使用`pythonw.exe`而非`python.exe`。
1795

被折叠的 条评论
为什么被折叠?



