views:

139

answers:

4

On Tiger, I used a custom python installation to evaluate newer versions and I did not have any problems with that*. Now Snow Leopard is a little more up-to-date and by default ships with

$ ls /System/Library/Frameworks/Python.framework/Versions/
2.3    2.5    2.6    @Current

  • What could be considered best practice? Using the python shipped with Mac OS X or a custom compiled version in, say $HOME.
  • Are there any advantages/disadvantages using the one option over the other?

My setup was fairly simple so far and looked like this: Custom compiled Python in $HOME and a $PATH that would look into $HOME/bin first, and subsequently would use my private Python version. Also $PYTHONPATH pointed to this local installation. This way, I did not need to sudo–install packages - virtualenv took care of the rest. Note: I liked this setup, so I'm just curious and thought I inquire the hive mind.

A: 

What you do on your on machine is totally up to you. If you're going to deploy your code to other people's, I'd say it's clearly preferable to use the shipped version unless you really need the newer version.

walkytalky
I disagree. Most packaged python software ships python inside the package, and that's the right way to do. God knows what the user installs on his machine.
unbeli
@unbeli If you're distributing a substantial application, OK. But for a few scripts? Exactly how many python interpreters does a machine need, anyway? And more generally, how does it make sense *not* to code for the baseline environment if all else is equal?
walkytalky
Well, scripts are not really "deployed", so there is no way to bundle python. There is no baseline you can trust here. I know it sucks, but that's life, no one promised it's not going to suck ;)
unbeli
+5  A: 

I guess it depends on your needs. Personally, I use the latest version for any series (2.5, 2.6, etc.) from MacPorts.

mipadi
+1 for macports
systempuntoout
+1  A: 

The problem with using the Python version that's shipped with your OS is that it may contain bugs, or be limited in other ways. If you install Python from Fink or MacPorts, you have the liberty of updating it.

Another, important advantage of managing your own version of Python with a package manager (Fink or MacPorts) is that they help a lot with the compilation of module dependencies (for instance when you use a module that depends on compiled C code). Thus, installing Python modules is certainly easier if you do not use the Python shipped with OS X. This is an important point to consider, before making your choice.

EOL
+2  A: 

I compile it myself because this gives me the newest 64-bit version. The official OS X builds seem to be 32-bit only. I dropped MacPorts several months ago because its dependency system and its often outdated packages were too annoying.

Philipp