jupyter notebook远程服务器设置
程序员文章站
2022-05-27 19:21:43
...
- 1.安装jupyter notebook
jupyter notebook安装坑: 或者miniconda创建环境后,在环境里用
conda install jupyter
而不是
pip install jupyter
- 2.生成配置文件
jupyter notebook --generate-config
- 生成密码
命令行输入ipythonipython
- 生成密码
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:ce23d945972f:34769685a7ccd3d08c84a18c63968a41f1140274'
把生成的密文‘sha:ce…’复制下来
- 修改默认配置文件,
$vim ~/.jupyter/jupyter_notebook_config.py
在空白处插入
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha:ce...刚才复制的那个密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #随便指定一个端口
- 5 重新启动jupyter notebook
- 6 在本地电脑浏览器输入
localhost:8888
localhost为服务器IP