tldr: How is python set up on a Mac? Is there a ton of senseless copying going on even before I start wrecking it?
I am hoping to get some guidance regarding Python system architecture on Mac (perhaps the answer is OS agnostic, but I assume for safety's sake that it is not).
I can run a variety of commands that seem to give me multiple Python binaries. In truth, there may be more this is just what I have come across so far.
ls /usr/local/bin/ | grep 'python\|pyd'pydoc pydoc2 pydoc2.7 python python-32 python-config python2 python2-32 python2-config python2.7 python2.7-32 python2.7-config pythonw pythonw-32 pythonw2 pythonw2-32 pythonw2.7 pythonw2.7-32
ls /usr/bin | grep 'python\|pyd'pydoc pydoc2.6 pydoc2.7 python python-config python2.6 python2.6-config python2.7 python2.7-config pythonw pythonw2.6 pythonw2.7
ls /Library/Frameworks/Python.framework/Versions/2.7 Current
ls /System/Library/Frameworks/Python.framework/Versions/2.3 2.5 2.6 2.7 Current
As far as which one runs when executing a .py ; when I run which python I get back
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
This seems consistent when I use the REPL. The site-packages relative to this install are available (not that I tinkered with other site package locs)
I have not made any serious modifications to my python environment on my Mac so I am assuming this is what is given to users out of the box. If anyone understands how all these binaries fit together and why they all exist please let me know. If the answer is RTFM please simply point me to a page as https://docs.python.org/2/using/mac.html did not suffice.
Thanks for making me smarter!
SPECS: Mac OS: 10.12.5
To answer your broader question about why there are various different executables for Python,
python pythonw python-config pydocSome more on the python versus pythonw difference: https://stackoverflow.com/a/30313091/1234300
Apart from that, you have some versions specifically labelled python-32 etc. Those will be 32-bit versions, compared to 64-bit which is probably what the other versions are on your system. Sometimes you may want to use a 32-bit version of Python because you want to link to other 32-bit code, including Python extensions or other shared libraries.