pythoneclipseconfigurationpydevturbogears

Configuration of Turbo Gears with Eclipse


I cannot find a way to get eclipse and TurboGears to work together.

I searched a lot online for an answer and cannot find it for the life of me.

I've successfully installed tg.devtools TurboGears2 WebOb Pylons WebFlash WebError Babel crank Routes WebHelpers Beaker decorator nose Mako WebTest Tempita Pygments repoze.lru MarkupSafe via cmdline and other tutorials.

But, I cannot find a good tutorial or anything to configure in eclipse or aptana or similar IDE.

Any help would be much appreciated! Thanks.


Solution

  • First of all, you will need to install PyDev, a Python IDE for Eclipse, which comes as an Eclipse plugin. You need to enter the URLs mentioned at http://pydev.org/download.html in Help -> Install new Software as a new Software Site and then select PyDev to be installed.

    I suppose you installed these package inside a virtualenv, like most guides should suggest! Then you will create an interpreter definition for PyDev, which will tell PyDev where to find the Python executable ($VIRTUALENV/bin) and which path to search for third-party packages ($VIRTUALENV/lib/python2.x/site-packages).

    You do that in Window -> Preferences -> PyDev -> Interpreter - Python. Click on the new button and select the python executable from your virtualenv (not the one from the system). In the next dialog, you need to select the package paths, I always need to add /usr/lib/python... to those.

    Afterwards you can save the interpreter definition and create a new PyDev Project, select your interpreter and you're ready to go. If you would now quickstart a new TurboGears project in your project directory, you could happily code along in Eclipse.