服务器 jupyter notebook配置

服务器 jupyter notebook配置

1. 建立config文件

jupyter notebook --generate-config

2. 进入.jupyter文件夹

cd ~/.jupyter

3. 打开 jupyter_notebook_config.py文件

vim jupyter_notebook_config.py

4. 修改jupyter_notebook_config.py文件,添加如下命令

#获取配置
c = get_config()
#设置为 * 表示所有 IP 都可以访问
c.NotebookApp.ip = '*'
#禁止Notebook 启动时自动打开浏览器
c.NotebookApp.open_browser = False
#指定访问的端口,默认是8888,自己设置一个即可
c.NotebookApp.port = 6006
#全0表示接受任何IP地址的访问
c.ConnectionFileMixin.ip = '0.0.0.0'
#允许远程访问
c.NotebookApp.allow_remote_access = True

5. 尝试打开jupyter notebook

jupyter notebook --ip=服务器ip

服务器 jupyter notebook配置_第1张图片

你可能感兴趣的:(教程,jupyter)