After starting out with Python on Ubuntu Linux, I've now for a good while been doing most of my sustained work on the Mac, currently Mac OS X 10.6. Unfortunately I've neglected to give proper attention to how Python is installed there and ended up with:
- Python 2.6.1 (Mac default version?) in
/usr/bin(also, 2.5.4, which I'm not sure how it got there) - Python 2.6.5 installed via MacPorts in
/opt/local/bin/. This is my default - I use
pipto install libraries, which end up in some ungodly place (something like/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/- SRSLY?) - Otherwise, mostly TextMate, and Git for version control. Django and Google App Engine, etc...
Now I'm preparing to set up 2.7 and 3.2, and I am unhappy with the haphazard state of things. So what are your favourite approaches to organising the code and libraries, and how have you wrestled the Mac into submission?
I'd like to continue using pip, but would like to have more control or at least understanding of what libraries for which version are getting installed and made accessible from where: I've had problems with installing py.test via pip and only being able to load it from the obsolete 2.6.1 Python, not my current 2.6.5 one. MacPorts has python_select, but it's not overly helpful:
reason: chris$ python_select -l
Available versions:
current none python26 python26-apple
Most Python people I've asked don't use MacPorts, which I don't much like, but the stock Mac Python from python.org. I've also heard the recommendation to use virtualenv systematically, so what is the link to a good practical introduction?