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
Allow for using the "old" source way of activating virtual environments #22289
Via #22270 . We would probably offer a setting to let you choose "command" or "environment variables" as how we would do virtual environment activation. We could leave the "on"/"off" option as separate so that things can (potentially) work with the dedicated "Python Terminal" command.
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future.
We do encourage people to continue 👍 the first/opening comment as it helps us prioritize our work based on what the community seems to want the most.
Brett Cannon (@brettcannon) - hi, does it mean the terminal will auto-activated with correct conda env without the setting conda config --set auto_activate_base False. Like auto run a command conda activate xxx when the terminal is first initialized.
Like auto run a command conda activate xxx when the terminal is first initialized.
This feature request would bring back the old way of activating environments as an option. If you're asking about the current way via environment variables, then please open a Discussion.
I need this! I've been using Zsh for Humans, and something about it just doesn't work at all with the new activation method. I think it's related to it running inside a headless tmux session, or something like that.
The old way worked perfectly for me.
Here's what's happening to me with this new method:
Boring stuff
❯ which python
/home/micael/.pyenv/shims/python
❯ which mypy
/home/micael/projects/playground/.venv/bin/mypy
❯ echo$VIRTUAL_ENV
❯ echo$PATH
/home/micael/.pyenv/shims:/home/micael/bin:/home/micael/.vscode/extensions/ms-python.python-2024.7.11281013/python_files/deactivate/zsh:/home/micael/projects/playground/.venv/bin:/home/micael/.pyenv/bin:/home/micael/.local/bin:/home/micael/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/micael/.cache/zsh4humans/v5/fzf/bin
❯ . .venv/bin/activate
❯ which python
/home/micael/projects/playground/.venv/bin/python
❯ which mypy
/home/micael/projects/playground/.venv/bin/mypy
❯ echo$VIRTUAL_ENV
/home/micael/projects/playground/.venv
❯ echo$PATH
/home/micael/projects/playground/.venv/bin:/home/micael/.pyenv/shims:/home/micael/bin:/home/micael/.vscode/extensions/ms-python.python-2024.7.11281013/python_files/deactivate/zsh:/home/micael/projects/playground/.venv/bin:/home/micael/.pyenv/bin:/home/micael/.local/bin:/home/micael/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/micael/.cache/zsh4humans/v5/fzf/bin
Notice how which python and echo $VIRTUAL_ENV change after manually activating the venv. I also don't get the venv indicator on my prompt without activating manually.
So as a workaround, you can use the old source way of activating virtual environments by adding one of these options in your settings.json (from specific to general):
"python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"]: it will disable this specific experiment
"python.experiments.enabled": false: it will disable all python experiments
"telemetry.telemetryLevel": "off": it will opt you out of A/B testing from VS Code and all other Microsoft extensions
Activity
github-actions commentedon Oct 23, 2023
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
brettcannon commentedon Jan 11, 2024
Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future.
We do encourage people to continue 👍 the first/opening comment as it helps us prioritize our work based on what the community seems to want the most.
EeyoreLee commentedon Jan 30, 2024
Brett Cannon (@brettcannon) - hi, does it mean the terminal will auto-activated with correct conda env without the setting
conda config --set auto_activate_base False. Like auto run a commandconda activate xxxwhen the terminal is first initialized.brettcannon commentedon Jan 30, 2024
This feature request would bring back the old way of activating environments as an option. If you're asking about the current way via environment variables, then please open a Discussion.
MicaelJarniac commentedon May 7, 2024
I need this! I've been using Zsh for Humans, and something about it just doesn't work at all with the new activation method. I think it's related to it running inside a headless tmux session, or something like that.
The old way worked perfectly for me.
Here's what's happening to me with this new method:
Boring stuff
Notice how
which pythonandecho $VIRTUAL_ENVchange after manually activating the venv. I also don't get the venv indicator on my prompt without activating manually.TheFlux7 commentedon May 29, 2024
#11039 is still labelled as "experiment"
So as a workaround, you can use the old
sourceway of activating virtual environments by adding one of these options in yoursettings.json(from specific to general):"python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"]: it will disable this specific experiment"python.experiments.enabled": false: it will disable all python experiments"telemetry.telemetryLevel": "off": it will opt you out of A/B testing from VS Code and all other Microsoft extensionseleanorjboyd commentedon Dec 8, 2025
Hi there! 👋
Please see this document for all the ways to configure activation here