'VS Code workspace with multiple Python virtualenvironments

How can I have two Python files open in VS Code, one in virtualenv A and one in virtualenv B, with code completion and linting? I'm porting something from using one lib to another which cannot be installed together, and I'd like to easily see the code and use all vscode features for both.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source