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.
I looked around the internet and found the following links purporting to help:
- The Daily Profeth: Google App Engine & eclipse PyDev
- Getting Started on Google App Engine with Flex and PyAMF (1)
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.