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
相关推荐
乘风对月歌1 天前
conda 或 vscode 中没有的虚拟环境
ide·vscode·conda
比奇堡的猪猪1 天前
修改默认conda环境(在win中)
python·conda
视图猿人2 天前
Conda的安装和使用-jupyter notebook
conda
itwangyang5203 天前
Windows + Conda + OpenMM GPU(CUDA)完整安装教程-50显卡系列
人工智能·windows·python·conda
小杜今天学AI了吗3 天前
如何配置 linux 系统的conda 环境
linux·运维·conda
gravity_w4 天前
Conda常用命令总结
经验分享·笔记·conda
雪风飞舞5 天前
conda 常用命令
linux·windows·conda
惊讶的猫5 天前
vscode+conda
ide·vscode·conda
arthur.dy.lee5 天前
在pycharm中使用powershell7解决conda,ohmyposh报错的问题
ide·pycharm·conda
num_killer5 天前
小白的uv包管理工具使用
python·conda·pip·uv