您的位置:首页 > 运维架构 > Linux

在centos7 下安装Anaconda 启动jupyter notebook

2017-11-29 17:48 936 查看
1.下载
https://www.anaconda.com/download/#linux
2.安装

# bash Anaconda3-5.0.1-Linux-x86_64.sh

选择默认安装路径:

Anaconda3 will now be installed into this location:
/root/anaconda3

- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below

[/root/anaconda3] >>>

安装中其他选项都选 yes

Thank you for installing Anaconda3!

[b][b]****[/b][/b]安装完毕*[b][b][b][b]**[/b][/b][/b][/b]
使生效:

# source ~/.bashrc

3.手动设置密码:

# python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from notebook.auth import passwd
>>> passwd()
Enter password:
Verify password:
'sha1:a59919c8215d:670d591c340f4fd92a2aea6f6f8da9d19eea6238'
>>>

'sha1:a59919c8215d:670d591c340f4fd92a2aea6f6f8da9d19eea6238'这一串就是要在 jupyter_notebook_config.py 添加的密码。

c.NotebookApp.password = u'sha1:a59919c8215d:670d591c340f4fd92a2aea6f6f8da9d19eea6238'

4.修改配置文件:
在 /root/.jupyter/jupyter_notebook_config.py中找到下面的行,取消注释并修改。

c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha1:a5...刚才复制的那个密文'
c.NotebookApp.open_browser = True
c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口

以上设置完以后就可以在服务器上启动 jupyter notebook,root 用户使用 jupyter notebook --allow-root。浏览器打开 IP:指定的端口, 输入密码就可以访问了。
后台启动:

#nohup jupyter notebook --allow-root&

如图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息