This post is admittedly for a very small niche of readers. If you are a Windows user - with virtually no Mac experience - and happen to be teaching college students how to program Python with Eclipse then read on…
I recently began my third semester teaching Intro to Business Programming at Fairfield University. Python is the language of choice for this course. For an IDE, we use EasyEclipse, which packages useful plugins together by purpose (LAMP, Java, etc.). One of the LAMP plugins is PyDev, which adds a very nice set of tools for writing Python scripts in Eclipse. However, PyDev needs to be told where to find the Python interpreter. On Windows, this is no problem. Students almost always accept the Python installer’s default install path or change it to Program Files. But the Mac…
I’ve spent very little time on a Mac. I can find my way around to get some things done (basic office work). I’ve never installed or configured software on a Mac. I’m not sure I’ve ever even powered one up… I couldn’t even describe the basic setup of a Mac. Shameful, I know… I like Apple. My iPod Touch is amazing. This is probably the single most impressive gadget I own (and I own many). But I hate Apple’s software. I’ll save that for another post, but for now I’ll ask why the search box has to lose focus when I Alt-Tab out of and back to iTunes?
Anyway… So clearly I’m guessing when I try to help a student find his or her Python interpreter. Fortunately, Mac bundles a Python interpreter into its OS. So no install woes. For those in the niche I described above, here’s the interpreter path to lead your students to:
/System/Library/Frameworks/Python.framework/Versions/2.3/bin/python
As far as I could tell, there were about 3000 other ways to find paths containing Python. Not sure what those were all about.
RSS feed for comments on this post. | TrackBack URI
February 25th, 2008 at 1:24 am
Thank you for posting this, I couldn’t figure out how to set up the pyDev interpreter for days!
February 25th, 2008 at 2:43 pm
No problem… Glad you found the post.
March 11th, 2008 at 1:56 am
This is for all the UNIX noobs =)
Open Finder, browse to the Applications now find the directory called Utilities go into it. Find the Console app and open it, now in the command prompt type window type the following without quotes
“whereis python”
Tada -> /usr/bin/python
You want to point to this because it is a link to your most current python version, should you ever upgrade to say python 2.4 then this should update auto-magically.
March 11th, 2008 at 4:19 pm
That seems all too simple! I really should just give up on Windows already…
May 14th, 2008 at 11:27 am
[…] Reference: On Using Pydev on a Mac. […]
May 27th, 2008 at 6:39 pm
I followed your instructions, but when eclipse tried to open the file, I got an error message saying that eclipse had unexpectedly closed. Also, in response to dan’s reply, I don’t have a file called python under “/usr/bin”, although when I typed “whereis python” into the terminal, I got the same output that you did. Do you have any more suggestions?
May 27th, 2008 at 7:00 pm
I’m sorry. You can ignore that last post. I managed to find the file, and eclipse opened it. Thanks so much for your help, I was completely lost without it.
August 2nd, 2008 at 7:40 pm
Thank you so much, it was taking me ages to find the freakin’ thing!
Thanks again