安装

centos端

  1. # 安装
  2. conda install -y jupyter notebook
  3. # 初始化配置
  4. jupyter notebook --generate-config
  5. vim ~/.jupyter/jupyter_notebook_config.py
  6. 修改配置
  7. c.NotebookApp.ip = '0.0.0.0'
  8. c.NotebookApp.open_browser = False
  9. c.NotebookApp.notebook_dir = '/home/alvin/file'
  10. # 启动
  11. nohup jupyter notebook > ~/jupyter.out &
  12. --port <port_number> 默认从8888开始

使用

第一次打开会要求输入token和初始化密码,很简单,如下:

  1. ~ tail ~/jupyter.out
  2. To access the notebook, open this file in a browser:
  3. file:///run/user/1000/jupyter/nbserver-8740-open.html
  4. Or copy and paste one of these URLs:
  5. http://iZ2ze1m0zmp2di7u8cb4kcZ:8888/?token=69061d7cf2d1a98466491659fffcde21a842d209ae399fa5
  6. or http://127.0.0.1:8888/?token=69061d7cf2d1a98466491659fffcde21a842d209ae399fa5
  7. [I 15:37:23.831 NotebookApp] 302 GET / (106.37.179.179) 0.67ms
  8. [I 15:37:23.851 NotebookApp] 302 GET /tree? (106.37.179.179) 0.80ms
  9. [W 15:37:36.540 NotebookApp] 401 POST /login?next=%2Ftree%3F (106.37.179.179) 2.32ms referer=http://www.tianyunperfect.cn:8888/login?next=%2Ftree%3F
  10. [W 15:38:06.128 NotebookApp] 404 GET /static/auth/js/main.min.js.map (106.37.179.179) 9.40ms referer=None

主界面:

image.png