-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
You may now see that when you open a new terminal, it does not auto-activate the python environment in this terminal.
This issue includes information and resolution to this problem:
We have decided to turn off the experiment "pythonTerminalEnvVarActivation" on VS Code Insiders. (It is still enabled for users on VS Code stable in the interim) This experiment was created a while back to implement auto-terminal activation, but proved to be buggy and highlighted that this approach is difficult to get right for every user. We are now moving over fully to the Python Environments extension as our long-term solution to all environment related tasks. This new extension will work hand in hand with the Python extension to provide a very much improved experience. Learn more about our roll out of this extension by default to Python users here.
With this in mind, these are the steps to get back environment auto-activation upon opening a terminal:
- Install the Python Environments Extension (published by Microsoft): https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-python-envs
- Add
"python.useEnvironmentsExtension": true,
to your USER settings (there is a chance this setting will show as "unknown" but it works) - Final do either:
A. Do nothing which keeps"python-envs.terminal.autoActivationType"
to its default valuecommand
and the activation command will be run in each terminal on open
B. Add"python-envs.terminal.autoActivationType": "shellStartup"
to your settings (user or workspace) which will inject the activation script into your shell script for a more automatic activation. Shell startup is only supported for zsh, fsh, pwsh, bash, and cmd.
Thank you everyone for your patience and feedback!