Step zero, install python with brew so you're not polluting the system python. After that you can make whatever mistakes you want with reckless abandon (and learn from them!)
Er... I have no idea what this means to be honest. Is matplotlib not executable within a given environment, i.e. with a particular PATH set? Cuz that's basically all you need for apps to use a virtualenv correctly.
If you make your virtualenvs with venv it will take care of that. So my setup is to ignore the system python, install 3.6 with brew, and simply venv off that every time. To be fair I still have a conda lurking around somewhere.
I am sitting on a Mac, my main development system, right now. I program mostly in Python these days and I really have no idea what these headaches you are talking about are. :-)
Of course, I never personally use the system installed Python - I have clean versions of Python 2.7 and 3.4-3.7 installed, and then I create new virtualenvs for every new project or even when I'm just experimenting with a new package.
If you're using Brew to install Python, that's likely your problem there. You want your development versions of Python to be completely independent of your system.
Indeed this rule is true for every system - if there's a system-installed Python, never change it in the slightest. I learned this the hard way, trying to change the system Python on a Linux box almost a decade ago.
(Looking at my notes, about six months ago I had some weird SSL problem with my 3.4 and virtualenv which seems to have resolved now, but aside from that I don't see much problematic on this machine...)
I've used a setup identical to yours for the last few years after making the mistake of replacing the system python on a Linux install. You can still get bit by a nearly pathological case: a configuration script that contains references to scripts using #!env python in most cases. But with a hardcoded /usr/bin/python burried in there for a single subdirectory... hilarity ensues.
213
u/ase1590 Dec 18 '18
Remember, a virtual environment a day keeps the xkcd superfund site away.