读书人

关于python本地调试出现No module nam

发布时间: 2012-12-30 10:43:15 作者: rapoo

关于python本地调试出现No module named google.appengine.ext 的问题
不知道什么原因。
我有一个项目虽然本地调试出现这个问题,但是可以上传GAE成功的。
但是另外一个项目也出现这个错误,但是不能上传成功。
因为python调试器只能显示一个错误同一时间,我怀疑还有其他语法错误,但是这个错误过不去,其他错误也不能调试出来。
急,有高手知吗?

可以加我QQ 414522115


#main.py
################## 主模块 #####################

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
def main():
application = webapp.WSGIApplication(
[('/.*', DefaultModule),
('/bbs', BbsModule),
('/joke', JokeModule),
('/music', MusicModule),
('/tv', TvModule),
('/film', FilmModule),
('/video', VideoModule),
('/game', GameModule)
],debug=False)

run_wsgi_app(application)

if __name__ == "__main__":
main()

#index.py

# -*- coding: UTF-8 -*-
import master
import wsgiref.handlers
import re,os,cgi,time,mimetypes,md5,urllib
from google.appengine.ext import db


from google.appengine.api import users
from google.appengine.ext import search
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from datetime import datetime, timedelta
from data import *

class DefaultModule(webapp.RequestHandler):
def get(self):
s = render(self, 'index.html')
self.response.out.write(s)

def render(self, file, vars = {}):
vars['master'] = master
return template.render(os.path.join(os.path.dirname(__file__), "../render/" + file), vars)


[解决办法]
你先把app.yaml中第一行的注释去掉,中文好像不支持

其他的,你再自己看吧

读书人网 >perl python

热点推荐