Benefits of conda vs. pip

1 minute read

conda and pip are not merely two different ways to install Python packages. Conda can install compilers such as gfortran and flang. Here are a few factors on where conda or pip have respective advantages.

For compactness, as usual in this article I use this shorthand:

  • “cross-platform”: working on Linux, MacOS and Windows

Ease of install

Python wheels greatly ease end-user install of libraries requiring compilation without the end-user needing a compiler. For example, high-performance Fortran, C and/or C++ code can be imported as a Python module, compiled beforehand and downloaded automatically. However, major packages like SciPy released cross-platform wheels only in late 2017 (SciPy 1.0.0). This means until 2017, easily installable, pre-compiled SciPy was not universal–some users would have to have Fortran, C and C++ compilers installed. For a large subset of Python users, compiling software libraries is not intuitive and end users disliked waiting 10 minutes for SciPy to compile itself.

A core design reason behind conda is excellent conflict resolution, so I often type conda install when I want to install something complicated like Spyder.

Easy virtual environments

The first-class conflict resolution of conda is matched by excellent virtual environment management.

conda env list

lists all the environments installed. This allows you to safely try out complicated programs like Mayavi that require numerous specific (old) Python package versions. Instead of ripping out the latest libraries you have, create Python environments with

conda create

High performance MKL Python libraries

Python Intel MKL FFT benchmark.

Nowadays,

pip install scipy

downloads and immediately makes available precompiled Fortran, C, C++ libraries within SciPy. Python wheels do not obviate Conda’s usefulness! One of the key advantages of using conda-installed packages are the free high-performance Anaconda MKL libraries, freely available since February 2016 for:

  • Numpy
  • SciPy
  • Scikit-learn

Although some specialized users may still want to compile Python libraries with Intel MKL, most will simply do as we recommend:

conda install numpy scipy scikit-learn

Notes

Leave a Comment