Search code examples
pythonterminalvisual-studio-code

Prevent Visual Studio Code from activating the Python virtual environment


With a Python project opened, whenever I open the integrated terminal in Visual Studio Code it's automatically activating the virtual environment. I'm sure that's done by VS Code because I can find this command in the bash history of that terminal:

source <project-directory>/venv/bin/activate

I don't want the virtual environment to be activated. How can we prevent VS Code from doing that?


Solution

  • Add "python.terminal.activateEnvironment": false to your settings (globally to your user settings if you never want it, otherwise your settings.json file which is found in .vscode directory; this folder is found in your workspace directory if this is a per-workspace thing for you; docs).