Python and Leopard

A messed-up Python installation on my Mac OSX Leopard system has caused me a fair amount of googling with no solution to be found. For no apparent reason, Python’s environment variable $PYTHONPATH got set to ‘/Applications/Dropbox.app/Contents/Resources’, causing havoc in Terminal and preventing IDLE from launching.

Several posts to the Python forum as well as the Apple Developer 101 discussion board got me no further than “Thank Dropbox’s authors for destroying your system and pray you have a backup.” This was evidently not the issue since Dropbox was working fine alongside Python and IDLE on my MacBook (although the fact that Dropbox.app contains a ‘Python.framework’ folder didn’t make figuring it out any easier). Googling about it came up with a fair amount of forum posts by people asking how to “reset” $PYTHONPATH or the sys.path variable to a default state. Replies were not very helpful, especially for UNIX neophytes like myself. Resintalling XCode, Dropbox, Python 2.6 or MacPython didn’t help either.

Luckily, I found a very simple solution that I thought I’d add to Google’s search engine: simply download and install the Mac OSX Combo Update for your version of Leopard (such as 10.5.5). This seems to fix the references to the default 2.5.1 framework that comes with Leopard, make importing modules functional again and, as a positive side effect, lets IDLE run.

and tagged ,

4 Comments

  1. fiddler
    Posted January 26, 2009 at 22:28 | Permalink

    Very few people seem to have this problem as theres is so little discussion about it. I got it after installing Dropbox yesterday. Tried to fix with “export PYTHONPATH=/usr/bin/python2.5,” but no help. So now downloading the latest combo update. Thanks for finding the solution!

  2. Tal
    Posted January 27, 2009 at 8:06 | Permalink

    I’m surprised since I was convinced that Dropbox didn’t have anything to do with it. I have Dropbox and Python running on the same OS version on a MacBook and didn’t have this issue. Are you sure it’s directly related to Dropbox?

  3. fiddler
    Posted January 27, 2009 at 22:40 | Permalink

    The night before I bumped into the problem I had been messing around with python and it was working ok. The only things I did with my system before the noticing problem was to install Dropbox and Skitch and try them out. Can’t believe Skitch has anything to do with it though. My problem happened on Santa Rosa MBP. Which mac hardware your problem was on?

  4. Tal
    Posted January 28, 2009 at 0:48 | Permalink

    Aluminium iMac 2.4. I’ll try and write something to the Dropbox team and see what they think of this.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>