[英]from google.appengine.ext.webapp.util import run_wsgi_app ImportError: No module named google.appengine.ext.webapp.util
I am a newbie to GAE. 我是GAE的新手。 I am using eclipse +Pydev.
我正在使用Eclipse + Pydev。 I am getting this error
我收到此错误
from google.appengine.ext.webapp.util import run_wsgi_app
ImportError: No module named google.appengine.ext.webapp.util
Here is what I am importing 这是我要导入的
import cgi
import webapp2
from google.appengine.ext.webapp.util import run_wsgi_app
import MySQLdb
import os
import jinja2
I am using UBUNTU. 我正在使用UBUNTU。 I have searched this error in stackoverflow and I did not find any convincing answers.
我在stackoverflow中搜索了此错误,但没有找到任何令人信服的答案。
I have even downloaded the appengine and reinstalled again and again but thats of no use. 我什至下载了appengine并一次又一次地重新安装,但这没用。
https://cloud.google.com/appengine/downloads https://cloud.google.com/appengine/downloads
Please provide me with a correct answer like links etc. DO NOT reply with you can find about this on this link etc.. I have searched for many links on the net and I couldn't find the convincing explanation to the problem. 请为我提供正确的答案,如链接等。请勿回复,您可以在此链接等上找到有关此内容的信息。
You need to make sure the App Engine SDK you downloaded is in your Python path. 您需要确保下载的App Engine SDK在Python路径中。 You can check what python thinks its path is by running python interactively:
您可以通过交互式运行python来检查python认为其路径是什么:
$ python
>>> import sys
>>> sys.path
['', '/Library/Python/2.7/site-packages/mock-1.0.1-py2.7.egg', '/usr/local/lib/wxPython-2.9.5.0/lib/python2.7/site-packages', '/usr/local/lib/wxPython-2.9.5.0/lib/python2.7/site-packages/wx-2.9.5-osx_cocoa', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages', '/usr/local/lib/wxPython-2.9.5.0/lib/python2.7']
Alternatively you can add the SDK to the python path at runtime. 或者,您可以在运行时将SDK添加到python路径。 For example, if you downloaded and unzipped to /home/username/google_appengine you could modify your python path in your script:
例如,如果您下载并解压缩到/ home / username / google_appengine,则可以在脚本中修改python路径:
sys.path.append('/home/username/google_appengine')
import dev_appserver
dev_appserver.fix_sys_path()
from google.appengine.ext.webapp.util import run_wsgi_app
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.