forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Do not use the old Python terminals to execute when interpreter changes #20018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
area-debugging
area-terminal
feature-request
Request for new features or functionality
needs PR
Ready to be worked on
Comments
Thanks I see the issue. With #11039 we'll do a better job of highlighting that a user needs to open a new terminal when environment changes. Particularly in case of executing and debugging, I'll leave this issue to open to investigate if we can open a new |
Closing as dup of #4581. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-debugging
area-terminal
feature-request
Request for new features or functionality
needs PR
Ready to be worked on
Uh oh!
There was an error while loading. Please reload this page.
Type: Bug
Behaviour
Expected vs. Actual
I am switching between different conda environments to test my code with different libraries / library versions.
I change the interpreter at workspace level to a different conda environment. The code seems to work fine the only issue is:
The terminal in which the code is executed still uses the old conda environment (showing the "(oldenv) user@pc:" prompt).
But the code runs fine in the new environment.
This is particular annoying because at first my thought was that the environment didn't change.
It also weird when checking in which environment the code was run.
Killing the terminal and executing the script again activates the correct environment.
It seems the solution could be running "conda activate currentenv" everytime when running/debugging another program, or on switching the current interpreter.
Steps to reproduce:
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2022.16.1
VS Code version: Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:16:26.920Z)
OS version: Linux x64 5.15.0-50-generic
Modes:
Sandboxed: No
A/B Experiments
The text was updated successfully, but these errors were encountered: