Originally posted in microsoft/vscode-python#944 (comment)
A (perhaps not so awesome) workaround is to not use bash and instead use PowerShell as the default terminal for VSCode, then set up your PowerShell profile to load the environment and activate the virtual environment. Now, "Run Python File" and debugging will all load the proper environment. If you have certain tasks in tasks.json
specially written for bash
, most of these will still work, as pwsh
has access to all the system utilities including sudo
. See my note at the end of this comment for more details on tasks.json
.
Install PowerShell in your distro by adding the Linux Software Repository for Microsoft Products and running sudo apt install powershell
afterwards, or else [follow one of th