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
相关推荐
qinyia6 小时前
如何彻底卸载macOS上的conda并清理环境变量配置
macos·conda
weixin_4215850121 小时前
Mamba与Conda
conda
qq_273900231 天前
Apptainer 将 Ubuntu 本地 Conda 环境打包为 Singularity(SIF)镜像
linux·ubuntu·conda
肆意飞扬2 天前
Python篇:使用conda、pip的一些命令记录
python·conda·pip
没事儿写两篇4 天前
Anaconda 的开源替代软件 Miniforge
开源·conda·miniconda·miniforge
次旅行的库4 天前
不能将windows本地虚拟环境打包到实验室服务器
linux·windows·conda
云和数据.ChenGuang6 天前
python对接mysql和模型类的故障
数据库·python·mysql·oracle·conda·virtualenv
Clarice__6 天前
VScode上的python使用教程
vscode·python·conda
存在即合理L6 天前
Windows中安装Anaconda后如何在powershell使用conda activate命令
windows·conda
m0_647057966 天前
PyCharm 2023.2.5 Conda Interpreter 解析失败问题排查与解决(macOS)
macos·pycharm·conda