conda 常用指令

conda 指令

查看配置

bash 复制代码
conda info

查看当前存在的虚拟环境

bash 复制代码
conda env list 

创建虚拟环境(环境名重要)

bash 复制代码
conda create -n 环境名 python=X.X

激活指定虚拟环境

bash 复制代码
conda activate 环境名

指定虚拟环境中安装指定包

bash 复制代码
conda install -n 环境名 包名

指定虚拟环境中删除指定包

bash 复制代码
conda remove --name 环境名  包名

关闭虚拟环境

bash 复制代码
conda deactivate 环境名

删除虚拟环境

bash 复制代码
conda remove -n 环境名 --all

查看当前环境中的包

bash 复制代码
conda list 

导出环境配置

bash 复制代码
conda env export > environment.yml

导入环境配置

bash 复制代码
conda env create -f environment.yml

清除缓存

bash 复制代码
conda clean -i 

显示配置文件

bash 复制代码
conda config --set show_channel_urls yes

查看软件源

bash 复制代码
conda config --show channels

添加源(以清华镜像源为例)

bash 复制代码
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

获取第三方库时显示搜索通道

bash 复制代码
conda config --set show_channel_urls yes

安装第三方库

  • 使用默认源下载
bash 复制代码
conda install 包名 
  • 使用镜像源下载(临时,以清华镜像源为例)
bash 复制代码
conda install 包名 -i https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/相应目录/

卸载第三方库

bash 复制代码
conda uninstall 包名
pip uninstall 包名

更改虚拟环境和包的存储路径

bash 复制代码
conda config --add envs_dirs D:\Anaconda3Data\envs
conda config --add pkgs_dirs D:\Anaconda3Data\pkgs
相关推荐
砍材农夫5 天前
python环境|conda安装和使用(1)
开发语言·后端·python·conda
匆匆整棹还5 天前
mamba的安装和版本对应
conda
2601_961875246 天前
花生十三资料1200题|题库|刷题
conda·pytest·pillow·pip·web3.py·ipython·gunicorn
没有钱的钱仔6 天前
自动创建conda虚拟环境,并安装依赖包
conda
砍材农夫8 天前
python环境|pip|uv|venv|Conda区别
后端·python·conda·pip·uv
pixelpilot18 天前
Conda:跨平台的二进制包管理器
其他·conda
lg_cool_9 天前
使用conda管理python运行环境并关联vscode
vscode·python·conda
javajenius9 天前
Pixi:用 Rust 重写 Conda 体验的包管理工具
开发语言·其他·rust·conda
小白弄潮儿9 天前
Conda 使用入门指南
conda
DFT计算杂谈9 天前
WannierTools输入文件wt.in一键批量生成脚本
java·前端·chrome·python·算法·conda