Git:使用conda命令切换虚拟环境

1. 问题

在win10电脑的Git中,无法使用conda list命令,报错(bash:conda:command not found)。也无法使用conda activate base命令激活虚拟环境,报错(bash:conda:command not found)。

2. 解决

1)解决在Git中使用conda命令的问题:配置环境变量。

2)解决无法使用【conda activate 环境名称】命令激活虚拟环境的问题。

输入conda init,然后重启Git bash。

复制代码
# 方式1:
source activate base          #1)先激活base
conda activate your_env_name  #2) 激活自定义的虚拟环境
conda deactivate              #3) 退出自定义的虚拟环境
 
# 方式2:
source activate your_env_name            #1)激活自定义的虚拟环境
source deactivate  或者 conda deactivate #2) 退出自定义的虚拟环境

方式1不可以的话就用方式2

相关推荐
AIMath~5 小时前
向github中上传文件过大超过50M怎么办
网络·git·github
AIMath~9 小时前
如何将一个新的文件夹使用git 工具提交到github新仓库中
git·github
满天星83035779 小时前
【Git】原理及使用(二) (版本回退)
linux·git
愿天垂怜10 小时前
【C++脚手架】ffmpeg 库的介绍与使用
linux·服务器·开发语言·c++·ide·git·ffmpeg
月夜的风吹雨10 小时前
Linux 基础开发工具详解:从 yum 到 gdb 实战指南
linux·git·ubuntu·centos·vim
好运yoo11 小时前
git cherry-pick
git
不是光头 强11 小时前
Obsidian Git 插件安装与配置完全指南
git
.千余12 小时前
【C++】C++核心语法:函数重载与缺省参数原理与避坑
c语言·开发语言·c++·经验分享·笔记·git·学习
meowrain12 小时前
Git HTTPS Token 凭据配置指南
git·网络协议·https
Ws_1 天前
Git + Gerrit 第二课:diff、暂存区与撤销修改
git