Jupyter 安装配置

服务器上配置 jupyter

可以参考 Running a notebook server

  • 安装Jupyter
1
pip install jupyter
  • 生成配置文件
1
jupyter-notebook --generate-config

记录配置文件位置,一般为/home/ubuntu/.jupyter/jupyter_notebook_config.py

  • 生成密码

打开Python/IPython Shell 生成密码的sha1秘钥

1
2
from notebook.auth import passwd
passwd()

接着输入并确认密码后,记录sha1秘钥值

  • 编辑配置文件

打开生成的配置文件

可以修改的常用配置项有

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 配置密码
c.NotebookApp.password = u'sha1:XXXXXXX'
# 配置访问的IP
c.NotebookApp.ip = '*'
# 默认不打开浏览器
c.NotebookApp.open_browser = False
# 设置端口
c.NotebookApp.port = 9999
# 设置打开的默认文件夹
c.NotebookApp.notebook_dir = u'/home/ubuntu/notebook'
updatedupdated2018-01-152018-01-15