在centos7 下安裝Anaconda 啓動jupyter notebook

1.下載
https://www.anaconda.com/download/#linux
2.安裝python

# bash Anaconda3-5.0.1-Linux-x86_64.sh

選擇默認安裝路徑:linux

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] >>>

安裝中其餘選項都選 yescentos

Thank you for installing Anaconda3!

****安裝完畢***
使生效:瀏覽器

# source ~/.bashrc

3.手動設置密碼:bash

# 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中找到下面的行,取消註釋並修改。ide

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:指定的端口, 輸入密碼就能夠訪問了。
後臺啓動:this

#nohup jupyter notebook --allow-root&

如圖:
在centos7 下安裝Anaconda 啓動jupyter notebookcentos7

相關文章
相關標籤/搜索