What is the difference between PyCharm Virtual Environment and Anaconda Environment?

I have to clarify that anaconda is just a collection. The real environment manager is conda. Here is miniconda. It just contains the necessary parts to manage the environment instead of a full anaconda collection.

conda is beyond a simple Python packages manager but is a system-wide package manager. It will help you to install packages without pain. A classic example is installing numpy on Windows. Without conda, it is really difficult as it needs a specific C compiler which is difficult to obtain. But with conda, you can install numpy with just one command conda install numpy. It will automatically solve compiler problem and C dependencies.


So back to your question, when you create an env in Pycharm, it will ask you which env do you want to create: Virtualenv Environment, Conda Environment, or Pipenv Environment. As for me, I usually choose Pipenv Environment as this env will be bound to the current project and can generate a lock file.

In this case, I think you can understand it now: There isn't an env named "created by PyCharm" or "Anaconda". There are only envs named "created by Virtualenv, Conda or Pipenv". And Pycharm just uses and wraps one of them.


So what is the difference between Conda Environment and Virtualenv Environment(Pipenv Environment essentially is a Virtualenv Environment with sophisticated pip)? The difference comes from their different purposes.

Conda Environment is usually for "Python user". They use Python as a tool to do some other works such as web crawling, data mining, and image processing. They don't know much about Python(as they don't need to know) so conda is as automatical as possible. And their tasks can be anywhere in the computer so the envs created by conda are located in user-wide directories. And they sometimes need different Python versions, this can be done in conda but not virtualenv.

Virtualenv Environment is usually for "Python developer". They use Python to build applications or packages. The envs created by Virtualenv are usually located in the current project's directory. So you can create an env for every application and manage dependencies easily.

To sum up:

Conda Environment:

  1. Manage not only Python packages but also different Python versions and system-wide dependencies.
  2. Envs are located in user-wide directories.
  3. Fewer envs.

Virtualenv Environment:

  1. Manage Python packages. The main purpose is to separate dependencies for every application.
  2. Envs are usually located in project-wide directories. (Although pipenv creates env in user-wide directories by default, many people think in project directories should be the default.)
  3. Much more envs.(A new env for every application)

For me, I use both of them. I use conda to manage different Python versions and use pipenv to manage dependencies for my applications.


Both environments are based on python's virtualenv, you can use them independently and configure (or install) packages inside it as you need, without the worry of conflicts. This is the essence of virtualenv.

Anaconda is a python distribution (just like linux distros) it by default add other packages based of it's opinion of what developers need. Hence, the installation is larger than if you install plain vanilla python. This is also why it's virtual environment is quite large.

Pycharm is an IDE, which happens to support the virtualenv feature of python. So it can create it for you, if you wish. It can use plain python distro to create it, so this will have a smaller size than if it uses a distro like Anaconda, as you have noticed.

The size issue is not specific to Anaconda, if you list all packages installed for you by anaconda conda list and install it manually yourself in the "lightweight" virtualenv you will see the size go up too. I believe you get my point.