Once in the Add Environment dialog box, select the Existing environment tab, then select a new environment from the Environment drop down list: You can also select Add Environment from the environment drop-down in the Python toolbar. To change the environment for a project, right-click the Python Environments node and select Add Environment. Switches to the Python Environments window in which you enter a name for the environment and specify its base interpreter.
See Activate an existing virtual environment. Prompts you to select a folder containing a virtual environment and adds it to the list under Python Environments, but does not activate it. The context menu on the Python Environments node also provides additional commands: Commandīegins the process of creating a new virtual environment in the project. If you clear all the options in the Add/Remove Python Environments dialog, Visual Studio activates the global default environment.
Your choice is saved with the project and that environment is activated whenever you open the project in the future. To quickly activate a different environment, right-click that environment name and select Activate environment. The currently activated environment appears in bold: Once you select OK, all the selected environments appear under the Python Environments node. From the displayed list, which includes global, virtual, and conda environments, select all the ones you want to appear under the Python Environments node:
To change the environment for a project, right-click the Python Environments node and select Add/Remove Python Environments.