Under the
Viewmenu selectCommand Palette... F1(or press F1 key).Type
Python: Select Interpreter.Choose which Python version to use by default [1].
[1] You can safely disregard the "Recommended" hint, which is usually the bare bones system one, without access to your custom packages.
Answer from Natsfan on Stack OverflowHello
The bottom right corner of VScode says that Python 3.12 is installed but when you type python --version in the terminal it returns version 2.7. I need it to be 3.12 in the terminal so I can pip install stuff.
Can someone explain what the hell I need to do, because i've been stuck trying to figure this out for three days now.
I'm new to vscode and i've only taken one course in python so please be nice
Thankyou for your help
Under the
Viewmenu selectCommand Palette... F1(or press F1 key).Type
Python: Select Interpreter.Choose which Python version to use by default [1].
[1] You can safely disregard the "Recommended" hint, which is usually the bare bones system one, without access to your custom packages.
Several of the answers here explain good approaches, but below are my top 2 recommendations.
1) Bottom Screen Navigation (ease of access)
- I find this the quickest approach; however, it isn't always available for first-time users. If you're already using Python in VS Code, this is usually the easiest way to reach the Python: Select Interpreter menu. On the bottom left of your screen, look for "Python X.X.X". This is the currently detected/configured version of Python for your project, and clicking it brings you to the interpreter menu to change the Python version you're using. At the time of writing, I was using Python 3.9.1 as seen in the snippet below:

2) Command Palette
- As @jmh denoted in his answer, you can also use the 'View' tab to navigate to the Command Palette. In the Command Palette, search for Python: Select Interpreter to bring about the same menu denoted above.
If you're still having issues, there's also a VS Code Getting Started guide that walks you through setting up Virtual Environments and/or choosing different interpreters for Python that support the desired language: https://code.visualstudio.com/docs/python/python-tutorial
Happy coding!
Issue with the interpreter in Visual Studio Code
How can i get the latest Python Version in Vscode?
Which version of Python is actually being used in VSCode?
Visual Studio Code is using Python interpreter that does not exist?
Videos
Hi, i ve got maybe a dumb question, but i can t find any informations how to upgrade my python version, besides the Indian guys trying to explain how to change the interpret in Vscode.
I ve got Linux mint and python 3.10. I want to use python 3.12 in Vscode. But Vscode doesn't offer me 3.12. sudo apt-get upgrade didn't help. I want to use 3.12 in a new venv, but I have no clue how to get it. A link or an explanation for dummies would be fine. Thx in advance!
At the bottom right of my VSCode window it says: Python 3.8.5 ('base': conda).
However, when I run the command in the VSCode terminal: "python --version" it returns 2.7.16,
and when I run the command: "python3 --version" it returns 3.9.12.
So which one is actually being used when running scipts?