Terminals don't have the virtualenv activated on reopening a workspace with a terminal
See original GitHub issueVS Code version
1.63.2
Extension version
2021.12.1559732655
OS type
Windows
OS version
10.0.19044.0
Python distribution
python.org
Python version
3.10.1
Language server
Default
Expected behaviour
On reopening a previously opened workspace that had terminals open and uses a virtualenv, the newly started terminal has the virtualenv activated.
Actual behaviour
The virtualenv is not activated, I have to close and reopen a new terminal for the virtualenv to be activated, or activate it manually.
This can be particularly annoying when accidentally executing a pip
command polluting the global environment by accident.
Steps to reproduce
- Open any folder with Python code.
- Create a virtualenv and select it as the Python interpreter for the extension.
- Open a terminal.
- Close VS Code.
- Reopen VS Code.
Logs
Experiment ‘pythonaacf’ is active Experiment ‘pythonTensorboardExperiment’ is active Experiment ‘PythonPyTorchProfiler’ is active Experiment ‘pythonDeprecatePythonPath’ is active
conda info --json ~/prj/cypcap/venv/bin/python ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py Python interpreter path: ./venv/bin/python /bin/python3 ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py /usr/bin/python3 ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py Starting Pylance language server. conda --version
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
It’s not enabled by default.
I solved my issue using this setting:
We have addressed environment activation issues in the recent releases. Please, try with the latest release and let us know if this is continuing to occur.