Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anaconda environment in Pycharm

I am trying to use Anaconda environment as an interpreter in Pycharm.

It actually works, but it's extremely slow - even running a single line "hello world" takes like 5 sec.

I guess the reason is Pycharm trying to activate the environment before every execution of the script and activation in Anaconda is generally slow (at least from my experience).

The execution speed is ok when using Anaconda root env. or when using virtualenv. Any idea/workaround how to speed it up?

like image 813
dreo Avatar asked Sep 28 '17 23:09

dreo


1 Answers

You should not activate the environment on every run. You need to define the interpreter for the project. It will take a couple of seconds to parse the installed packages in that environment and later it will be fast.

https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html#project-interpreter

I wonder if there is something special in the packages you have in your environment. Five seconds is not normal.

Have you tried creating a new environment from pycharm?

https://www.jetbrains.com/help/pycharm/conda-support-creating-conda-environment.html

and later adding the packages that you really need for that project?

like image 71
Juan Leni Avatar answered Oct 14 '22 02:10

Juan Leni