I have google app engine
installed to /home/mydev folder such that dev_appserver.py is in /home/mydev/google_appengine
directory.
In eclipse helios,I have pydev and for my project's PYTHONPATH,I added the path /home/mydev/google_appengine/lib
under external libraries.
Still,pydev compains it cannot resolve
import webapp2
Any idea how to solve this?
I am using Eclipse Indigo 3.7.2, PyDev 2.2.3, and GAE 1.6.5 and I get the same problem by pointing external libraries to /home/mydev/google_appengine/lib
(or the equivalent on my machine), but it resolves when I point the external libraries to /home/mydev/google_appengine
, the parent directory.
Hope this helps (this is an empirical solution that worked for me and have no specific reason why it works).
You need to add /home/mydev/google_appengine/lib/webapp2 in PYTHONPATH. Because within this directory only webapp2 module resides.
When inside PyDev, have you created your project as a google app engine project (that's a project type that PyDev has)... The wizard to create that kind of project should automatically get the google app libraries so that your import works.
See: http://pydev.blogspot.com.br/2009/05/testing-on-pydev-146-google-app-engine.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.