使用 conda activate ./envs 命令激活新环境时,VS code bash 开始显示这些 ASCII 字符
以下命令用于在特定位置创建并激活环境。 但激活环境后,bash 终端的文本将更改为下图中突出显示的 ASCII 字符。
conda create --prefix ./envs
conda activate ./envs
The following commands were used to create and activate the environment in a specific location.
but after activating the environment the text of the bash terminal changes to ASCII characters highlighted in the below image.
conda create --prefix ./envs
conda activate ./envs
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于某些缓存问题,这是 VS Code 在创建虚拟环境时非常常见的问题。解决方案是:
关闭 VS Code 并打开 GitBash
然后输入以下 cmd:
rm ~/.condarc
此命令将删除运行时配置文件。
如果显示“未找到此类文件或目录”,则也没有问题。
现在输入以下命令:
conda config --set env_prompt '({name})'
现在打开 VS Code 并激活环境。问题将会得到解决。
此命令会将您的环境名称(整个文件路径)更改为基本名称(环境文件夹名称)
希望此解决方案有所帮助。如果您有任何疑问,请联系我。
This is a very common issue in VS Code while creating a virtual environment due to some cache issue. The solution for this is:
Close VS Code and Open GitBash
Then type in the following cmd:
rm ~/.condarc
This cmd will remove the runtime configuration file.
If it says "No such file or directory found", then also no issues.
Now type the following cmd:
conda config --set env_prompt '({name})'
Now open VS Code and activate the env. The Problem will be solved.
This command will change your env name (which was the entire filepath) to just the base name (env folder name)
Hope this solution helps. If you have any queries just ping me.