搭建Python3的jupyter notebook服务器

 

摘要:搭建Python3 jupyter notebook。

激活Python3后,进入Python交互环境

1. 登陆远程服务器

2. 生成配置文件

1. $jupyter notebook --generate-config

3. 生成密码

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

1. In [1]: from notebook.auth import passwd
2. In [2]: passwd()
3. Enter password: 
4. Verify password: 
5.  Out[2]: ' sha1:fa0dde171852:7afe4911d125a73f091298be12aa0c199e3b9350'

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

4. 修改默认配置文件

$vim ~/.jupyter/jupyter_notebook_config.py 

服务器是windows的话是在

C:Usersyourusername.jupyterjupyter_notebook_config.py
进行如下修改:

c.NotebookApp.ip=' *' #所有ip都可以访问
c.NotebookApp.password=u'sha1:fa0dde171852:7afe4911d125a73f091298be12aa0c199e3b9350'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #随便指定一个端口
 

5. 启动jupyter notebook:

1. $jupyter notebook

6. 远程访问

此时应该可以直接从本地浏览器直接访问http://address_of_remote:8888就可以看到jupyter的登陆界面。

会提示输入密码,这个密码是刚才第二步生成的密码

我们的密码是12345678

原文地址:https://www.cnblogs.com/zle1992/p/9046820.html