vscode-python: Deactivate environment command broken for venv
Workaround
This is a known issue, see https://github.com/microsoft/vscode-python/issues/22037#issuecomment-1736462876 for a workaround in bash.
Expected vs. Actual
Expected: running deactivate
exits the venv in that particular shell context
Actual: running deactivate
shows command isn’t found
(data-loader-prototype-py3.10) [admin-smiller@UUE2OLY01L olympus]$ deactivate
bash: deactivate: command not found
Behaviour
I would expect the environment to be properly sourced in my bash shell context. Instead commands like “deactivate” are not found given the inital shell context.
Steps to reproduce:
- Select a python interpreter via the python plugin
- Open an new terminal
- Try deactivating the default environment
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 2
- Comments: 21
Yes it works, adding this combined block of code into
~/.bashrc
Thanks.Thanks, I’ve edited the original comments so that folks can easily focus on the workaround. Created https://github.com/microsoft/vscode-docs/issues/6590 so we officially document this limitation on VS Code docs.