Visual Studio Code Terminal Doesn't Activate Conda Environment
Solution 1:
First, open the Anaconda prompt (How to access Anaconda command prompt in Windows 10 (64-bit)), and type:
conda activate tom
To activate your virtual environment.
Then to open Visual Studio Code in this active environment, type
code
And it should work.
Solution 2:
I was facing the same issue for a long time and nothing seemed to work. Out of nowhere, VS Code suggested me the following in a notification prompt:
We noticed you're using a conda environment. If you are experiencing issues with this environment in the integrated terminal, we recommend that you let the Python extension change "terminal.integrated.inheritEnv" to false in your user settings.
I clicked yes
on it and worked. You can also manually set this in your settings.json as follows:
- Press
Shift + Command + P
to open command palette. - Type settings.json and select `Preferences: Open Settings (JSON)
- In the JSON file, add the key-value pair
"terminal.integrated.inheritEnv": false
- Save the JSON file
Solution 3:
- In Vscode hit ctrl+` to open your terminal.
- Then within the terminal type:
conda init
. - Close and reopen the terminal.
- Use Conda normally.
Solution 4:
This seems to be because the Anaconda installation recommends not changing the windows PATH to reference anaconda, as it can clash with other installations, I had no problems when my PATH variable was modified. It seems like vs code (or most likely the Python extension) is still not activating anaconda correctly itself.
Post a Comment for "Visual Studio Code Terminal Doesn't Activate Conda Environment"