Repository navigation
Allow for using the "old" source way of activating virtual environments #22289
Description
Activity
- addedfeature-requestRequest for new features or functionalityRequest for new features or functionality
on Oct 23, 2023 - addedtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
on Oct 23, 2023 - addedarea-environmentsFeatures relating to handling interpreter environmentsFeatures relating to handling interpreter environmentsneeds community feedbackAwaiting community feedbackAwaiting community feedbackcommunity askFeature request that the community expressed interest inFeature request that the community expressed interest inand removedtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
on 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.
- addedneeds proposalNeed to make some design decisionsNeed to make some design decisionsand removedneeds community feedbackAwaiting community feedbackAwaiting community feedback
on Jan 11, 2024 brettcannon commented
on Jan 11, 2024 MemberAuthorMore actionsThank 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 commandconda activate xxxwhen the terminal is first initialized.brettcannon commented
on Jan 30, 2024 MemberAuthorMore actionsLike auto run a command
conda activate xxxwhen 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 pythonandecho $VIRTUAL_ENVchange after manually activating the venv. I also don't get the venv indicator on my prompt without activating manually.Reacted by ldepaulatrac and Fioravante#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 extensions
Hi there! 👋
Please see this document for all the ways to configure activation here- removedneeds proposalNeed to make some design decisionsNeed to make some design decisions
on Dec 8, 2025
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.