首页 > 解决方案 > 视觉工作室代码蟒蛇问题

问题描述

我正在尝试在 Visual Studio 代码上运行 python 代码,但为此我需要 ta-lib。有人建议我使用 anaconda 安装 ta-lib,所以我得到了 anaconda,它要求我将其设置为我的主要 python,所以我这样做了。这样做之后,我尝试运行我的代码,但它给出了:

conda activate base
conda : The term 'conda' is not recognized as the name of a 
cmdlet, function, script
file, or operable program. Check the spelling of the name, 
or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ conda activate base
+ ~
    + CategoryInfo          : ObjectNotFound: 
(conda:String) [], CommandNotFoundExceptio
    n
    + FullyQualifiedErrorId : CommandNotFoundException

然后我尝试卸载 anaconda,但这样做之后它仍然被设置为我的主要 python。

有谁知道让 Visual Studio 代码不参考 anaconda 作为主要 python 或让 Visual Studio 代码与 anaconda 一起使用的方法?

标签: pythonanaconda

解决方案


当您打开一个 .py 文件时,在左下角您应该能够看到类似 的内容Python 3.9.4 64 bit,或者与 python 相关的内容。然后点击它,它看起来像这样在此处输入图像描述

然后从那里你可以选择你想要使用的 python 解释器。


推荐阅读