I use Python extensively on my Mac OS X, for both numerical applications and web development (roughly equally). I checked the number of Python installations I had on my lapt
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
autoenv
or direnv
and automatically activate virtual environments when you enter a directory by putting the conda command inside the .env
or .envsrc
file.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