pip are not merely two different ways to install Python packages.
Conda can install compilers such as
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
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
High performance MKL Python libraries
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
Anaconda MKL libraries,
since February 2016 for:
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