The focus of this answer is to get the conda python environments to work with the Python Environments extension in vs code. There are many ways to do this, each has different effects and implications on how you want to interact with Python in vs code.
My Environment: Windows 10, Conda 23.7.4, Conda installed in C:\apps & I am using PowerShell 7 not windows PowerShell.
1. Opening vs-code via Anaconda navigator or type ```code``` in conda prompt. This loads Conda environments in to Python Environments window. Includes nice ui conponents. This also removes conda from the powershell terminal. So you can write "activate myenv".
2. If you want to open vs code directly, add to settings:
```
"python.condaPath": "C:\\apps\\Anaconda3\\Scripts\\",
"python.venvPath": "C:\\apps\\Anaconda3\\envs",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
```
This method puts conda environments in Global and has another folder for Venv.
3. The following will run base conda in all powershell terminals: in conda prompt run ```conda init``` & add to settings:
```
"python.condaPath": "C:\\apps\\Anaconda3\\Scripts\\",
"python.venvPath": "C:\\apps\\Anaconda3\\envs",
```
The focus of this answer is to get the conda python environments to work with the Python Environments extension in vs code. There are many ways to do this, each has different effects and implications on how you want to interact with Python in vs code.
My Environment: Windows 10, Conda 23.7.4, Conda installed in C:\apps & I am using PowerShell 7 not windows PowerShell.
1. Opening vs-code via Anaconda navigator or type ```code``` in conda prompt. This loads Conda environments in to Python Environments window. Includes nice ui conponents. This also removes conda from the powershell terminal. So you can write "activate myenv".
2. If you want to open vs code directly, add to settings:
```
"python.condaPath": "C:\\apps\\Anaconda3\\Scripts\\",
"python.venvPath": "C:\\apps\\Anaconda3\\envs",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
```
This method puts conda environments in Global and has another folder for Venv.
3. The following will run base conda in all powershell terminals: in conda prompt run ```conda init``` & add to settings:
```
"python.condaPath": "C:\\apps\\Anaconda3\\Scripts\\",
"python.venvPath": "C:\\apps\\Anaconda3\\envs",
```