1. 程式人生 > >linux多虛擬環境安裝jupyter notebook

linux多虛擬環境安裝jupyter notebook

檢查 false 文檔 adt 下載 grep zip 修改配置文件 book

1.linux環境下載python虛擬環境Miniconda包
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh

2.安裝Miniconda依賴包
yum -y install bzip2

3.安裝
sh Miniconda3-latest-Linux-x86_64.sh

4.配置改別名
vim /root/.bashrc
...
#alias for conda
alias cl="conda env list"
alias cc="conda create -n"

alias coa="source activate"
alias cod="source deactivate"
alias cr="conda remove --all -n"
...
:wq

5.創建一個python虛擬環境
cc lcs
coa lcs

6.安裝jupyter notebook
pip install jupyter notebook

7.檢查是否安裝
pip freeze |grep jupyter

8.修改配置文件
jupyter notebook --generate-config
vim /root/.jupyter/jupyter_notebook_config.py

c.NotebookApp.notebook_dir = ‘/root/notebook‘ # notebook默認目錄
.....
c.NotebookApp.ip = ‘*‘
#c.NotebookApp.password = u‘sha1:bcd259ccf...<your hashed password here>‘
c.NotebookApp.open_browser = False
:wq

jupyter notebook password
jupyter notebook --allow-root

9.客戶端瀏覽器登陸jupyter

51cto博客:de8ug
Jupyter官方文檔:http://jupyter-notebook.readthedocs.io/en/latest/notebook.html

linux多虛擬環境安裝jupyter notebook