简体   繁体   中英

Trouble running python in VS code python terminal

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.

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:

蟒蛇VSC

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM