作为python 开发,经常要使用 conda。以下是常用命令,不定期更新(用到哪记到哪呗)

环境管理

创建环境 : conda create --name <env_name> python=<version>

激活环境 : conda activate <env_name>

退出环境 : conda deactivate

列出环境 : conda env list

删除环境 : conda remove --name <env_name> --all

克隆环境 : conda create --name <new_env> --clone <old_env>

导出环境 : conda env export > environment.yml

从文件创建环境 : conda env create -f environment.yml

包管理

安装包 : conda install <package_name>

指定版本安装 : conda install <package_name>=<version>

从指定频道安装 : conda install -c <channel> <package_name>

卸载包 : conda remove <package_name>

更新包 : conda update <package_name>

更新所有包 : conda update --all

列出已安装包 : conda list

搜索包 : conda search <package_name>

配置管理

查看配置 : conda config --show

添加频道 : conda config --add channels <channel>

移除频道 : conda config --remove channels <channel>

设置镜像 : conda config --add channels <mirror_url>

清理 清理缓存 : conda clean --all

其他

查看Conda版本 : conda --version

更新Conda : conda upgrade conda

更新全部包:conda update --all

查看帮助 : conda --help