美文网首页
2. 远程访问jupyter notebook

2. 远程访问jupyter notebook

作者: 杂记_ | 来源:发表于2021-01-02 22:56 被阅读0次

想在本地远程访问jupyter notebook,则需要进行如下配置:

1. 登陆远程服务器

2. 生成配置文件

jupyter notebook --generate-config

3. 生成密码

打开ipython,创建一个密文的密码

In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password: 
Verify password: 
Out[2]: 'sha1:ce23d945972f:34769685a7ccd3d08c84a18c63968a41f1140274'

把生成的密文‘sha:ce…’复制下来

4. 修改默认配置文件

$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

jupyter notebook --ip 0.0.0.0    

6. 远程访问

从本地浏览器访问http://address_of_remote:8888就可以看到jupyter的登陆界面了。

相关文章

网友评论

      本文标题:2. 远程访问jupyter notebook

      本文链接:https://www.haomeiwen.com/subject/ldpjoktx.html