Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using pydev with Eclipse on OSX

Tags:

python

eclipse

I setup PyDev with this path for the python interpreter /System/Library/Frameworks/Python.framework/Versions/2.5/Python since the one under /usr/bin were alias and Eclipse won't select it. I can run my python script now but cannot run the shell as an external tool. The message I get is

variable references empty selection ${resource_loc}

Same if I use {container_loc}

Any thoughts ?

Sunit

like image 817
Sunit Avatar asked Apr 01 '09 03:04

Sunit


People also ask

Why is PyDev not showing in Eclipse?

it seems that you installed pydev with wrong version. remember check your java version(by typing java -version in console). if it says 1.6. X, then you should NOT check "Show only the latest versions of available softerware" option in the first popup window after "Help->Install New Software" clicked.

How do I open PyDev in Eclipse?

Go to Window → Open Perspective → Other and choose PyDev, then click OK. If you look at the upper right corner you will see that the perspective has changed from "Java" to "PyDev".

How do I download PyDev in Eclipse?

Quick Install Note: View http://www.pydev.org/update_sites to browse the update sites for other versions. An alternative is just getting the zip file and extracting it yourself in the eclipse dropins (and restart Eclipse).


2 Answers

I installed the Python.org version as well, this is a must.

I finally got PyDev working in Eclipse by pointing the interpreter to:

/Library/Frameworks/Python.framework/Versions/2.6/bin/python

manually. If you don't do it manually (by using the Autoconfig) it seems to not find the right version.

like image 92
Maurizio Avatar answered Sep 27 '22 21:09

Maurizio


Common practice seems to be to install an up-to-date Python 2.5 from python.org and use that instead of the system installation. I saw that recommended here and there when I got started on Mac OS X.

It installs under /Library (as opposed to /System/Library) so the system Python is intact. Pydev has /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python as its configured Python interpreter and all is well.

Can't state for sure that your trouble is due only to using the system's Python installation; in any case this way I have no trouble. Also, this way when you fiddle with your development environment (install things in site-packages, upgrade Python), anything that uses the system Python is sure to be unaffected.

like image 34
Gunnlaugur Briem Avatar answered Sep 27 '22 21:09

Gunnlaugur Briem