OS X - Deciding between anaconda and homebrew Python environments OS X - Deciding between anaconda and homebrew Python environments numpy numpy

OS X - Deciding between anaconda and homebrew Python environments


I use Homebrew Python for all my projects (data science, some web dev).

Conda is nothing fancy, you can have the same packages by hand with a combination of pip and Homebrew science. Actually, it is even better because you have more control on what you install.

You can use your virtualenvs only when you do web development. For the numerical applications you will probably want to have the latest versions of your packages at all times.

If you want to update all your packages at once with pip, you can use this command:

sudo -H pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 sudo -H pip install -U

EDIT: This answer is old, if you want a more up-to-date comparison, I found this nice blog article which compares the two approaches:

https://towardsdatascience.com/pipenv-vs-conda-for-data-scientists-b9a372faf9d9

I still use Homebrew Python, and pip / pipenv over conda.


Workflow that I've found the best:

  • Use conda for virtual environment management. Never use / install into system python.

  • Use pip to install into the active virtual environment, just like normal.

  • Use conda packages only for hard to install software, such as Qt.

Automation / extras

  • Use autoenv or direnv and automatically activate virtual environments when you enter a directory by putting the conda command inside the .env or .envsrc file.