6 ms·
How does one go about updating Python on OSX Snow Leopard?
by AaronMT 16y ago
How does one go about updating Python on OSX Snow Leopard?
- watmough 16y agoThere's a useful page here: http://www.python.org/download/mac/ http://www.python.org/download/mac/ Basically, since the OS X Python is usually a bit behind, you are recommended to get the full install package.
- babo 16y agoCompiled from source and using it from a separate folder it's fine for me. Also added easy_install from source and used that to install a few libraries like boto, readline, ipython, etc. without a problem.
- rbanffy 16y agoYou can also use ports. I assume it will have a 2.7 port shortly, if it doesn't already.
- ant5 16y agoLooks like 2.7rc2 is in the repository. If you don't want to wait for the maintainer, you can: sudo port edit python27 This will use your $EDITOR (mine is vi, yours might be textmate). Change the version from 2.7rc2 to 2.7: version 2.7 and set the checksum value to: sha1 6bbcd1ab16d07765a7a405671e1e43a2e74b8e6a Then simply: sudo port install python27 Boom. You can make it the default 'python' (if /opt/local/bin comes first in your path) via: sudo port install python_select sudo python_select python27 python --version Python 2.7 The next 'port sync' will override your local portfile changes. If you want to keep them, you can also copy the port somewhere else, or even set up your own local tree of port files. ('port dir python27' to get the path to the port for copying). Also, if you fail to update the checksum, port(1) will tell you what it should be (which is how I got the line to use above).
- telemachos 16y agoI wouldn't recommend overwriting OSX's Python. You can install yourself from source into /usr/local, but a package manager like MacPorts or Homebrew helps a lot. It's a little more work up front - to install the package manager - but it pays itself back over time. Homebrew has 2.6.5 in its main branch, and 2.7 in a fork. See the notes here: http://github.com/mxcl/homebrew/blob/master/Library/Formula/python.rb http://github.com/mxcl/homebrew/blob/master/Library/Formula/... I've tried Fink, MacPorts, Rudix and Homebrew. Homebrew isn't perfect, but it's damn good.
- ant5 16y agoI'm not sure what makes Homebrew better than MacPorts. Most of their self-declared advantages -- the largest one being that they don't replicate OS-provided software -- are going to fall over as soon as the software included with Snow Leopard starts getting a bit stale. Case in point, Snow Leopard ships with Python 2.6, and now people are going to want 2.7. [Edit] I think it's also enlightening to look at this breakdown of the advertised homebrew features circa last year: http://news.ycombinator.com/item?id=872072 http://news.ycombinator.com/item?id=872072
- telemachos 16y agoI don't think it's perfect, but I can tell you why I have come to prefer Homebrew: 1. It's far faster. Installations and all operations take less time. 2. It's far lighter. Sure disk space is cheap, but why waste if I can avoid it? 3. It's written in a language I know well enough to contribute. (Ruby as opposed to Tcl.) And Github is Homebrew's secret weapon here. There are literally hundreds of us with forks, providing constant updates. Packages are updated far faster than Fink or MacPorts. Momentum counts. 4. They maintain a branch dedicated to providing duplicates, where people really want them. I install Vim in just this way, and they in fact provide multiple versions of Python. That said, it's not for everyone. I didn't object to MacPorts. The only option I really think is bad is overwriting the system's Python, as I said.
- deleted 16y ago[deleted]
- telemachos 16y agoFaster/lighter how, exactly? Faster in the simplest sense: sudo port install x takes longer to finish than brew install x. Lighter in just as straightforward a sense: same installations, less space used (fewer dependencies I suppose). The "it's Ruby" argument was entirely personal. I like to hack and help, if I can. Here I can. Rudix provides binaries, but fewer packages. The funny thing is that not that long ago, I was as skeptical as anyone. I installed Homebrew only recently when I updated two machines to Snow Leopard - mostly to prove to myself it wasn't just inertia and stubborn keeping me with MacPorts. I stayed with it because it works so well. I didn't update my post in reply to you. I often write a quick reply and then do a bunch of expanding edits. Bad habit- sorry. I haven't tried MacPorts in a few months. Maybe it's much faster. I got very, very tired of editing the Python portfile to remove the TK dependency that dragged in an entire xorg system. But I think that deep is now optional. Again, I don't have a religious attitude towards Homebrew. I tried it, and I'm very happy with it for now.