conda命令


1. 创建虚拟环境

conda create -n  python=     # 创建新环境
conda create -n  --clone ENV              # 复制现有环境,  Path to (or name of) existing local environment.

2. 激活虚拟环境

conda activate <虚拟环境名称>

3. 删除虚拟环境

conda remove -n (虚拟环境名称) --all     

4. 卸载某个包

conda uninstall   

5. 退出当前虚拟环境

conda deactivate

6. 更新命令

conda update conda            # 更新conda
conda update --all            # 更新所有包
conda update    # 更新指定的包        

7. 查看命令

conda list        # 查看安装了哪些包。
conda env list    # 查看创建的虚拟环境

 8. conda清理

conda clean -p           # Remove unused packages from writable package caches.
conda clean -t           # Remove cached package tarballs.
conda clean -i           # Remove index cache.
conda clean -y -a        # Remove index cache, lock files, unused cache packages, and tarballs.

9. conda环境打包

9.1 安装conda-pack

conda install conda-pack

9.2 pack命令

conda pack -j 8 -o tar.gz>    # 导出的文件名

10. 导出环境清单和恢复

10.1 导出

conda env export -f      # 文件名

10.2 恢复

conda env create -f   # 文件名