This type of error happens when the operating system is trying to directly run a Python file, but does not have an indicator that it is a Python file. Under Unix and Linux, unlike Windows, the file extension (.py for Python, but also any other) - is just perfume. The operating system looks at the first bytes of the file to understand what type of file it is, and in the case of script files, call the correct interpreter.
In short, put the line down as first line from your Python script:
#! /usr/bin/env python3
Okay, this indicates to the operating system that it should use the "env" program to find out which is the correct program, in the current environment, to run a script in python3 .
This will fix your specific error, but there may still be another configuration error in your vscode - it should know, regardless of the operating system, that your script is in Python , and call the appropriate interpreter (I can’t tell if vscode looks at the file extension or what it does). The error you put is most common when running a Python program straight from the terminal.
This has something to do with Mr. Path, fix it, it’ll work
– FourZeroFive