Google App Engine & eclipse PyDev

I’ve been looking at Google App Engine recently, and thought I’d have a go at developing something using Eclipse (my main IDE) with the Python development plugin PyDev rather than a motley collection of text editors and scripts.  Here’s how I got on so far.

I already have Eclipse Europa, so I connected to the PyDev update site I told PyDev where my Python interpreter is located and accepted the default pythonpath entries, then created a new PyDev project and pasted in the example code from the Google App Engine tutorial.

All was going well up to this point, but then I hit a problem. PyDev was showing errors in the code indicating that it could not find the App Engine modules and classes to import.

Import Errors

I looked around the internet and found the following links purporting to help:

Adding in the pythonpath settings from the first one didn’t seem to work. I tried a variety of combinations including creating a new appengine project with the appropriate source folders and referenced it in my new project. Still no luck.

So I created a new project following the steps in the second link, and there were no import problems, even though by default it contains a very simple web application using the App Engine. So I copied and pasted the code from the offending module into the new project and everything seems fine now. I have set up the dev server as a run target in Eclipse and it runs sweetly.

I can only assume that it was the order in which I did things, somehow. Perhaps adding pythonpath entries after code is already present is not picked up correctly by PyDev. Dunno, but I hope this helps someone.

One Comment

  1. It’s a funny old editor, eclipse is. I spent the first year or two battling with it to do simple things because I didn’t believe it could do them without me controlling it. It could, but only if I let it do things “its way”. Now that I know how to do all the things I really need, I’m starting to look at some of the things I might want. I hated the search facilities with a vengeance, yet now they are my friend – I use them almost as much as “find” and “grep” .. OK, not quite that much.

    It’s no surprise you’re having a hard time with Eclipse/Python … I tried Fortran in it, and went back to vi after a few days. But hey, somebody’s got to get stuck in and find the bugs, eh?

Comments are closed.