I am a beginner in Python. I used VS Code as a text editor.
While running a code the command started with python -u and I got an error. But I got my expected result in the terminal tab when I started my code with python3. So how to change Python’s version in the output panel by default?
OUTPUT PANEL SHOWING AN ERROR
2
Answers
~/.bash_profile
.alias python='python3'
BTW, according to your picture, I guessed that you didn’t install Python and Pylance extensions. You can install them and read document about python in VSCode for more details.
python
in mac usually points topython2
, but currently the system no longer pre-installspython2
, so you need to pointpython
topython3
.Execute the following command in terminal
Also you are using Code Runner to execute the script which is not the recommended way. You should use Python extensions for more features and better experience.