今天折騰了一下Conda,整理了一下常用到的幾個命令
系統(tǒng):Mac OS 10.13.4
管理Conda
# 獲取信息
conda info
# 獲取版本號
conda --version
# 獲取幫助
conda --help
# 移除
rm -rf ~/anaconda
# 升級
conda update conda
管理 Channels
# 添加Anaconda的TUNA鏡像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
# 設(shè)置搜索時顯示通道地址
conda config --set show_channel_urls yes
管理 Environment
# 創(chuàng)建
conda create -n env_name python=3.5
# 創(chuàng)建 environment.yml
conda env create -f environment.yml
# 激活
source activate env_name
# 關(guān)閉
source deactivate
# 克隆
conda create --name env_new --clone env_old
# 刪除
conda remove -n env_name
# 查看 env 列表斥难,帶* 的是當前激活 env
conda info -e
包管理
# 查看環(huán)境下的包
conda list
# 安裝包
conda install -n env_name package_name
# 移除包
conda remove -n env_name package_name
參考資料