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
相关推荐
hyunbar3 天前
卸载 conda(太大) 安装 miniconda
conda
索西引擎3 天前
【LangChain 1.0】环境搭建指南:从 conda 到 uv 的现代化 Python 工程实践
python·langchain·conda
charlee443 天前
《GIS基础原理与技术实践》配套案例(Python版)
python·conda·numpy·gis·环境配置
Will_Ye4 天前
Ubuntu中pip 缓存和conda的缓存路径修改
缓存·conda·pip
一只积极向上的小咸鱼4 天前
Conda 环境迁移说明
conda
fengchengwu20124 天前
Conda 虚拟环境操作手册:从入门到精通
python·conda
威尔逊·柏斯科·希伯理4 天前
机器学习第一天(共12天)
人工智能·python·机器学习·conda·numpy·pandas·matplotlib
有态度的时光4 天前
Vscode/cursor编辑器无法识别conda命令或者切换找不到包
vscode·编辑器·conda·找不到包
小鱼~~5 天前
conda常用命令
人工智能·conda