I have Miniconda3 installed at C:\\Users\\me\\Miniconda3, and my \'Project Interpreter\' within PyCharm set to my conda environment, and that is all working correctly. Howev
Great answer by dd.
It helped me out as well, but I chose to do it in a slightly different way in PyCharm.
It appears we can get the Anaconda prompt running in the PyCharm terminal without having to redirect to a new Shell path, ie. we may keep the original Shell path which in my case is "C:\Windows\System32\cmd.exe"
for Windows 10. And instead point to the Environment Variables that are used by the conda command prompt, in the following way:
echo %PATH
from the conda command prompt as described here in the answer by Rob
/ Adrian
. If you have already set the PATH for the python interpreter in PyCharm you can find it here: Settings - Build, Execution, Deployment - Console - Python Console
. Click the folder button to the right of Environment variables input and then copy the path value from the Value field to the right of the variable under NameSettings - Tools - Terminal
+
symbol. Name it PATH
and paste in the previously copied value. Click OK and then ApplyYou could restart PyCharm, or close and restart Terminal within PyCharm, in order to make sure the changes have been recognized.
Now you should be able to use for instance both pip list
and conda list
within the same Terminal window within PyCharm. In my case the former command returns a smaller list compared to the larger list from the other command (from conda).
Regardless, it appears you should now be able to use both within one, ie. to use the same Terminal window to perform conda and regular python operations, for instance for installations.
Sidenote: Though the two-in-one option works for the Terminal windows it does not seem to work for the Python Console - where I use the conda one within PyCharm. In that Console it currently only recognize packages from the conda interpreter and not the packages from my previous regular python interpreter.
Anyway, hope this helps other people! If anyone has any insights into whether or not this is a viable solution in the long run, please let me know.
You can change pycharm settings to achieve this.
In Settings > Tools > Terminal, change the Shell path
as following:
cmd.exe "/K" "C:\Users\me\Miniconda3\Scripts\activate.bat" "C:\Users\me\Miniconda3"
And the C:\Users\me\Miniconda3
can be replaced by either one of your conda environment name such as base
Close the Terminal and reopen it, you will get the Anaconda prompt.
It works in my PyCharm Community Edition 2018.1.2
The shell path may differ, you can check from the properties of shortcut of 'Anaconda Prompt': rightClick on the icon of 'Anaconda Prompt' >> properties >> shortcut >> Target
For window user, first of all check the location of your anaconda environment
you could type conda env list
to show
For my case, the env I want to have my anaconda prompt is located at C:\Users\YOURUSERNAME\Anaconda3\
(which is the root env, the very first you get)
And then go to pycharm, go settings, go Tools, Inside Shell path enter
cmd.exe "/K" C:\Users\YOURUSERNAME\Anaconda3\Scripts\activate.bat C:\Users\YOURUSERNAME\Anaconda3