x = 10
print(x)
我得到的消息:
PS H:VS Code100 Days of CodeDay16 - OOP> 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
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (conda:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
File "<stdin>", line 1, in <module>
NameError: name 'X' is not defined
>>> print(x)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'x' is not defined
>>>
这是一个通用错误,表明没有安装conda
,或者至少在您试图运行它的命令行中无法访问它。这和Python无关。
我不知道为什么你使用conda
这个任务,但我认为它是有关这个100 Days of Code
的事情?
程序有没有给你一些关于如何设置环境的说明?也许你可以再看一遍。
你可能还会发现使用专门的python编辑器有一些好处,它可以让你在不运行Powershell的情况下处理你的python文件。
如果你确信Powershell + Conda是正确的,你将需要安装Conda,并将其暴露在Powershell路径下。