tags:

views:

967

answers:

3

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

A: 

I believe ${resource_loc} or ${container_loc} (without any argument) are based on the current selection in your workbench when you are launching your script.

So are you selecting the right resource when selecting that script through the "external tool" runner ?
At least, click on the project name before you run one of the external programs.
Note: it works with a selection in the Navigator or Package Explorers views (the latest might not be available in PyDev environment though)

VonC
+1  A: 

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.

Gunnlaugur Briem
I agree you should try the python.org version and not the system python.
Aaron
A: 

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.

Maurizio