skip to Main Content

I’m using python 3.10.7 on VS Code and often when I run my files (In the terminal using CodeRunner), it does print the output of the files but just prints the error almost every time and I want to know what it means and what I can do about it.

script : The term 'script' 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                                                                                                                                                ncluded, verify that   
the path is correct and try again.
At line:1 char:1
+ script -a /tmp/extension/2022911/Users/terLog
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (script:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I’m guessing it’s something to do with coderunner "/tmp/extension/2022911/Users/terLog" but honestly I’m very confused, it’s been happening for about a month.

SCREENSHOT OF MY VSCODE WINDOW

2

Answers


  1. Welcome to Stack Overflow!

    You seem to be using a nonexistent cmdlet called ‘script’, that is what is causing the problem.

    I suggest trying to use

    python <file>.py
    

    or

    python3 <file>.py
    

    , whichever works for you.

    Login or Signup to reply.
  2. Install python extension and use the following way(The upper right corner of the vscode interface) to run python file:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search