Home > Net >  How to solve error in VS Code - exited with code=127
How to solve error in VS Code - exited with code=127

Time:12-24

Baffled by this. I've been using VSCode for a few weeks and have python installed.

def print menu():
    print ("Let's play a game of Wordle!")
    print ("Please type in a 5-letter word") 
        print_menu()
print_menu()

So far so simple, but when I run it I get this

[Running] python -u "/Users/davidelks/Dropbox/Personal/worldle.py" /bin/sh: python: command not found

[Done] exited with code=127 in 0.006 seconds

What does this mean? I'm guessing it failed but why? This appears to be trivial.

UPDATE:

Tried:

def print menu():
        print ("Let's play a game of Wordle!")
        print ("Please type in a 5-letter word") 
        
    print_menu()

It failed.

CodePudding user response:

Try to end your filename with (.py) or try reloading the python extension.

CodePudding user response:

Try entering the VSCode command. On linux, you can digital control shift P.

In the dialog that appears at the top, type: select python interpreter.

Select option: Python: select interpreter

After that, select the python interpreter you intend to use with your VSCode and see if it worked.

  • Related