環境
從鏡像下載下傳
//py2
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda2-5.3.1-Linux-x86_64.sh
//py3
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.1-Linux-x86_64.sh
安裝
sh Anaconda3-5.3.1-Linux-x86_64.sh
//# 安裝路徑輸入 /usr/local/anaconda3
//# 安裝過程選擇不加入~/.bashrc
環境變量
$ vi /etc/profile.d/conda.sh
export CONDA_HOME=/usr/local/anaconda3
export PATH=$PATH:$CONDA_HOME/bin
$ source /etc/profile
檢查
//# 查詢安裝資訊
$ conda info
鏡像設定
//# 添加清華大學倉庫鏡像
$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
//# 下載下傳包時,顯示下載下傳的url
$ conda config --set show_channel_urls yes
虛拟環境
//# 新增虛拟環境
$ conda create --name py3.6 python=3.6
//# 加入PATH
$ vi /etc/profile.d/py3.6.sh
export PATH=$CONDA_HOME/envs/py3.6/bin:$PATH
// 激活虛拟環境
$ source activate py3.6
//# 檢視Python版本
$ python -V
//# 退出虛拟環境
$ source deactivate py3.6
//# 删除虛拟環境
$ conda remove --name py3.6 --all
//# 檢視虛拟環境
$ conda info -e
删除anaconda
rm -f /etc/profile.d/conda.sh
rm -rf ~/anaconda
rm -rf ~/.anaconda
rm -rf ~/.condarc
rm -rf ~/.conda
rm -rf ~/.continuum
rm -rf /usr/local/anaconda3