Jupyter Notebook的安装步骤
1,下载Anaconda
我们可以进入官网下载:
https://www.anaconda.com/download/
2,将Anaconda2-5.0.1-Linux-x86_64.sh进行安装
[root@master tmp]# bash Anaconda2-5.0.1-Linux-x86_64.sh
3,之后一路按Enter和yes
4,生效.bashrc文件
[root@master tmp]# source ~/.bashrc
5,输入python,验证环境
Python 2.7.13 |Anaconda 4.4.0 (64-bit)| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>>
6,配置环境,生成jupyter notebook的配置文件
jupyter notebook –generate-config --allow-root
7,生成登陆密码
[root@localhost ~]# ipython
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:70dd3321fccb5b5d77e66080a5d3d943ab9752b4'
8,修改配置文件(主要修改以下几个配置,并去掉注释#)
vi /root/.jupyter/jupyter_notebook_config.py 或者
vi ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip='0.0.0.0' #设置成为0.0.0.0意思是允许所有机子访问
c.NotebookApp.password = u'sha1:5311cd8b9da9:70dd3321fccb5b5d77e66080a5d3d943ab9752b4'
# 上面这个密码就是我们刚才在ipython中生成的密码
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #随便指定一个端口,使用默认8888也可以
9,启动jupyter notebook的服务
jupyter notebook --allow-root
10,打开浏览器访问
输入
https://0.0.0.0:8888
然后输入我们设置的密码就可以访问了
这里写图片描述
进行测试,说明可以使用
网友评论