How to change code runner on vs code from python u to python 3

Hello, I am starting the python course and I am on a Mac so I need to change the default python code runner from python u to python 3. the tutorial cant be used on the current vscode version. please does anyone know how to change this

I’m also experiencing the same problem on Mac, anyone with any useful information please

Hey Mattie. By any chance did you figure this out

Having the same problem on mac. Sublime text uses python3 but cannot get VS Code to recognize it. Homebrew shows Python 3.9.

In vs code press shift + command + p.
Search for python interpreter and click on “Python: select interpreter”
On the top it has an option “Enter interpreter path”. Select that and enter the path to the python version you downloaded and installed on your machine.
Hope this helps you friends.

If you still haven’t firgured this out.
I hope this helps you.

I followed the steps but it’s still showing python -u :frowning:

Make sure you are entering the correct path to your interpreter .
In your terminal run “where python3.10” or whichever version you wanna use and copy the path it gives you and paste it in VsCode. When you selected the path restart VsCode.

Thank you for your help but I can’t get the path at terminal. It said invalid syntax :frowning:

You’re probably running the “where python3” command in the VsCode terminal.
Your VsCode terminal is probably running python so when you enter the command it tries to run the command as a python code. That’s why it’s saying invalid syntax.
Make sure it’s not running python or use the your computer’s terminal instead of your project’s terminal to get the path to your interpreter.

I got it. Thank you!

1 Like

Did you successfully change your python to python3 ?

When I was clicking on the triangle (run code) it told me: python -u bla bla error
Then I clicked on the arrow pointing down near this triangle and selected: run python file and this is working with my selected interpreter.
Run code (triangle) is still running with python -u and not working for some python files

update:
I downloaded python package from the official site and now everything seems to work