Reputation: 325
even stuff like help(int) seems to give me error in vs code terminal for python
help(int)
int : The term 'int' 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:6
+ help(int)
+ ~~~
+ CategoryInfo : ObjectNotFound: (int:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Other examples:
from dateline import date At line:1 char:1 + from dateline import date + ~~~~ The 'from' keyword is not supported in this version of the language. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : ReservedKeywordNotAllowed
Although running this from the editor seems to be fine.
Upvotes: 1
Views: 1974
Reputation: 1938
It seems that you're using the Python extension for VSCode.
As it is merely an interpreter that runs on PowerShell, you will still need to prepend your command with python
for it to work, such as python script.py
, shown in the screenshot below:
Upvotes: 1