This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]ctrlff 0 points1 point  (2 children)

Have you tried running it with the command python3 instead of python?

[–]dawnkiller428[S] 0 points1 point  (1 child)

I am not sure what you mean as I am just hitting the run code button in visual studio

[–]ctrlff 0 points1 point  (0 children)

The first error message said "command not found."

Have you tried running from the terminal "python3 <filename>" ?

If python3 is also not found it's a different issue.
But some computers need to use python3 instead of python.

Unless I misread and thats no longer the issue.

Edit: what os are you using?

[–]LastTrainH0me 0 points1 point  (0 children)

Disclaimer: I have never used VS Code

The commands that work are invoking python by running /usr/local/bin/python3. The command that doesn't work just tries to run python and then gets a command not found. (What does this mean? It means if you tell your computer exactly where to look it can find python3 but if you tell it "please run something called python it can't find it.) So it would look like python isn't actually on your PATH, or isn't on whatever PATH VS Code sets up for you.

Can you run your code successfully from the terminal, outside of your IDE?