You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VSCode Debugger always uses wrong Python interpreter despite selecting correct one when debug current python file. #855
As shown in the attached screenshot, my active terminal is using the base environment (highlighted in the bottom-left corner).
I selected base as the project interpreter via Ctrl + Shift + P → Python: Select Interpreter (highlighted in the bottom-right corner).
However, when I use the debugpy extension to debug the current Python file, the debugger always launches using the openr1 environment instead (note: this is the first Conda environment name that appears in the Python: Select Interpreter command palette), therefore cause import error: no module found.
Even after executing the following commands, the issue persists:
Python: Clear Workspace Interpreter Settings
Python Debugger: Clear Cache and Reload Window
Python: Clear Cache and Reload Window
Root Cause
After extensive troubleshooting, I discovered that the issue is caused by the Python Environment Manager VSCode extension.
Once I uninstalled that extension, everything worked correctly — the debugger began using the selected interpreter as expected.
Note
The VSCode extension Python Environment Manager (deprecated) doesn't have this problem.
Expected Behavior
The debugger should respect the interpreter selected via Python: Select Interpreter.
Actual Behavior
The debugger ignores the selected interpreter and always uses the first Conda environment (openr1).
Hi! I have just made changes here which are out on the latest version of the debugger extension pre-release. Are you able to try this on the pre-release version and see if that helps? If not can you add this setting python.useEnvironmentsExtension and try again? This will also change the behavior to use our new extension for handling and selecting python environments
Eleanor Boyd (@eleanorjboyd) Thank you for the recent updates! I have just tested with the latest version of the Python Environment Manager VSCode extension, and the issue described above no longer occurs — the debugger now uses the same Python environment as the one selected via the Python extension's Select Interpreter option.
However, I noticed that the latest version of Python Environment Manager also provides a Select a Python Environment option in the lower right corner of the window. This functionality seems to significantly overlap with the Select Interpreter option provided by the Python extension.
When the interpreter selected via the Python extension and the one selected via Python Environment Manager are different, the environment from the Python extension is activated first, followed by the environment from Python Environment Manager. Moreover, when using the debugpy extension to debug the current Python file, the environment that gets activated is still the one selected via the Python extension's Select Interpreter option.
In summary, it seems that the Select a Python Environment feature in Python Environment Manager may be redundant.
huh that is wild, it is supposed to replace the python extension menu bar item not be a duplicate one. Can you uninstall and re-install the python extension and see if that does anything? I think something very strange happened where the extensions aren't communicating right together
This issue has been closed as it has been labeled with info-needed and has not received the additional information that was requested from the issue author. It has been labeled as info-needed for 7 days.
I have a similar issue. I select an environment (3.11) but I get a message
"3.11" is already selected as the environment ..."
but the selected environment below (lower right corner) still shows "base (3.13.11)"
Activity
eleanorjboyd commentedon Nov 5, 2025
Hi! I have just made changes here which are out on the latest version of the debugger extension pre-release. Are you able to try this on the pre-release version and see if that helps? If not can you add this setting
python.useEnvironmentsExtensionand try again? This will also change the behavior to use our new extension for handling and selecting python environmentscuiluyi commentedon Nov 10, 2025
Eleanor Boyd (@eleanorjboyd) Thank you for the recent updates! I have just tested with the latest version of the Python Environment Manager VSCode extension, and the issue described above no longer occurs — the debugger now uses the same Python environment as the one selected via the Python extension's Select Interpreter option.
However, I noticed that the latest version of Python Environment Manager also provides a Select a Python Environment option in the lower right corner of the window. This functionality seems to significantly overlap with the Select Interpreter option provided by the Python extension.
When the interpreter selected via the Python extension and the one selected via Python Environment Manager are different, the environment from the Python extension is activated first, followed by the environment from Python Environment Manager. Moreover, when using the
debugpyextension to debug the current Python file, the environment that gets activated is still the one selected via the Python extension's Select Interpreter option.In summary, it seems that the Select a Python Environment feature in Python Environment Manager may be redundant.
eleanorjboyd commentedon Nov 14, 2025
huh that is wild, it is supposed to replace the python extension menu bar item not be a duplicate one. Can you uninstall and re-install the python extension and see if that does anything? I think something very strange happened where the extensions aren't communicating right together
glad to hear the interpreter is now right tho!
vs-code-engineering commentedon Nov 22, 2025
This issue has been closed as it has been labeled with
info-neededand has not received the additional information that was requested from the issue author. It has been labeled asinfo-neededfor 7 days.aurelienfalco commentedon Feb 19, 2026
I have a similar issue. I select an environment (3.11) but I get a message
"3.11" is already selected as the environment ..."
but the selected environment below (lower right corner) still shows "base (3.13.11)"
shakez0901 commentedon Feb 23, 2026
aurelienfalco Same here. For me, the new "Python Environments" extension caused this, disabling the extension solved it
liyiersan commentedon Mar 26, 2026
Thanks, it works for me.
alectutin-qut commentedon Jul 28, 2026
Same for me today