/ 数据分析

centos 安装 jupyter notebook

1.先安装pyenv
2.安装高版本python

pyenv install 3.5.3

3.设置密码

[root@localhost ~]# python

Python 3.5.2 (default, Aug  4 2017, 02:13:48) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password: 
Verify password: 
Out[2]: 'sha1:5311cd8b9da9:70dd3321fccb5b5d77e66080a5d3d943ab9752b2'

4.安装jupyter

pip install jupyter

5.生成并且修改配置

jupyter notebook --generate-config

c.NotebookApp.ip='*'
c.NotebookApp.password 'sha1:5311cd8b9da9:70dd3321fccb5b5d77e66080a5d3d943ab9752b2'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888  

6.守护进程运行(之前需要配置安全组,设置对应端口)
nohup jupyter notebook --ip=0.0.0.0 --no-browser --allow-root & tail -f nohup.out
nohup command > myout.file 2>&1 &

7.ip加端口访问,输入密码即可