python - Conda 激活基本错误 - 无法识别术语 "conda"

标签 python visual-studio-code anaconda

我尝试将 anaconda 与 Visual Studio 代码结合使用,但每次尝试运行某些内容时都会收到此错误消息。

enter image description here

enter image description here

我尝试/确认的内容:

已安装 Python 3.9.1,当我使用标准环境或在命令终端内时,在 VSC 中运行代码没有任何问题。

anacoanda 表示它使用的 python 版本是 3.8.5。应该是 3.9.1 还是正常的?

Python 和 anaconda 在安装过程中已添加到路径中 - 我之前已经做过该操作。

大概 anaconda 安装正确。我可以访问导航器和命令提示符。

这不是我写的代码。我尝试简单地编写 print("Hello") ,但它给了我同样的错误。

安装了最新版本的 anaconda。

最佳答案

我也遇到了同样的问题。原因是VS Code默认使用powershell终端,但powershell默认不激活conda环境。

因此,建议您使用cmd终端或者系统自带的其他终端。 (因为在VS Code中,它使用的终端是从系统集成的终端,它不仅仅支持powershell终端。)

解决方案:例如切换到使用cmd终端:

enter image description here

enter image description here

引用:Integrated terminal in VS Code .

关于python - Conda 激活基本错误 - 无法识别术语 "conda",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66166898/

相关文章:

python - 属性错误:模块 'utils' 没有属性 'init logging'

python - 使用 PyInstaller 或 cx_Freeze 使用 Anaconda2 生成非常大的文件

python - 将特定列添加到单行列表(可能有点基础)

python - GAE 给我发电子邮件错误

python - 逻辑与按位

linux - 如何清除 Mac/Linux 机器上的 Visual Studio Code 缓存?

twitter-bootstrap - 如何将我的所有 vscode 文件从 4 个空格缩进格式化为 2 个空格?

python - 如何在spyder中传递 bool 参数?

python - 训练SVM分类器需要多少时间?

node.js - 在 Docker 中调试服务器上的 nuxtjs .vue 文件