When I run the following hellow world program (with the GAE Launcher) it works:
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
app = webapp2.WSGIApplication([('/', MainPage)],
debug=True)
However If i go to the terminal I can't import webapp2:
C:UsersRobert>python
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import webapp2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named webapp2
>>>
Also my IDE provides no autocomplete for webapp2 objects.
Seeing as GAE Launcher uses the same python version as I use in the terminal, I'm confused as to how the import must work within the GAE launcher.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…