I have the following strange situation on my (freshly installed El Capitan, otherwise empty) Mac.
I noticed that
/usr/bin/python defaults to python 2.7 (still), and the new SIP security system "protects" me from replacing it with a symlink to point to python3 (which I installed in
/usr/local/bin). I noticed that
/usr/local/bin shows up first on the path:
$ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
So I thought great, I'll just add a symlink in
python and point it to python3.
$ ls -al /usr/local/bin ... lrwxr-xr-x ... python -> /usr/local/bin/python3 lrwxr-xr-x ... python3 -> ../Cellar/python3/3.5.0/bin/python3
And this is reflected by
$ which python /usr/local/bin/python
But when I actually use it, it goes back to the native python2.7
$ python --version Python 2.7.10
What gives? Is OS X tinkering with my
$PATH and not telling me? What steps can I take to ensure I know what command is actually going to be run?