PyCharm terminal doesn't activate conda environment

I ran into the same problem and used this solution.

  1. Go to File -> Settings -> Tools -> Terminal.

  2. Replace the value in Shell path with cmd.exe "/K" C:\path\to\Anaconda3\Scripts\activate.bat your_environment_name.

If I installed Anaconda in C:\Anaconda3 and have an environment named myenv, then my settings would look like this:

Terminal Tool Application settings


This seems to be a known issue.


If any one wondering for settings for Linux, here is how to do it. Create a file .pycharmrc in your home dir. Open the file and add following

source ~/.bashrc
source ~/anaconda3/bin/activate your_env_name 

Now go to Pycharm File > Settings > Tools > Terminal > Shell path replace your shell path with /bin/bash --rcfile ~/.pycharmrc.

Now when you open your terminal specified conda env will activate.