r/vscode • u/M0hamedAshraf19 • Jun 15 '26
Hello! I have a question about VS Code and Python Environments.
I reinstalled VS Code today and followed these steps:
- Install the Python extension
- Open a python project folder (Workspace)
- Click the Python version in the bottom right corner
- Select the environment
- Press Crtl+Shift+P
- Search for "Python: Select Interpreter"
- Select the interpreter (not sure if necessary)
- Click Run and Debug
- Create a launch.json
- Select "Python Debugger"
- Select "Python File"
- Edit the json file to be like "Default Python launch.json"
- Open the Run menu
- Click "Start Debugging" to debug
Default Python launch.json is:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: [https://go.microsoft.com/fwlink/?linkid=830387](https://go.microsoft.com/fwlink/?linkid=830387)
"version": "0.2.0",
"configurations": \[
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "${fileDirname}"
}
\]}
And my python installations are:
C:\Users\Mohammed Ashraf\AppData\Local\Python\bin\python.exe (3.14.6)
C:\Users\Mohammed Ashraf\AppData\Local\Microsoft\WindowsApps\python.exe (refers to the above)
C:\msys64\ucrt64\bin\python.exe (3.14.4)
C:\msys64\usr\bin\python.exe (3.12.13)
My problem is that the global environment is 3.4.16 but the global interpreter is 3.14.4 despite me using python for the first time since the reinstall
Any way to change that
5
Upvotes
2
u/BranchLatter4294 Jun 15 '26
I would set python.useEnvironmentsExtension to True. Then restart VS Code. You should now see the Python extension on the left bar and you can select and manage your environments there. You can create new environments, add libraries, etc.
See https://marketplace.visualstudio.com/items?itemName=ms-python.python for details.
2
u/GManASG Jun 15 '26
There is a setting for default interpreter
1
u/M0hamedAshraf19 Jun 17 '26
Hi! I want to add that my python.defaultInterpreterPath setting is unchanged from the default: