2012-11-16 112 views
1

Possible Duplicate:
PyDev project for Google App Engine not finding webapp2连接到从Python的

我做了HelloWorld教程,不能从Python的连接谷歌的数据存储;

这是app.yaml文件:

application: "ceemee11111" 
version: 1 
runtime: python27 
api_version: 1 
threadsafe: true 

handlers: 


- url: /.* 
    script: helloworld.app 

builtins: 
- remote_api: on 

这是helloworld.py的开始:

import cgi 
import datetime 
import urllib 
import webapp2 

from google.appengine.ext import db 
from google.appengine.api import users 


class Greeting(db.Model): 
     """Models an individual Guestbook entry with an author, content, and date.""" 
     author = db.StringProperty() 
     content = db.StringProperty(multiline=True) 
     date = db.DateTimeProperty(auto_now_add=True) 

在Python Shell我CHDIR到的HelloWorld 进口的HelloWorld

,并得到导入错误“No module named webapp2”

Th e应用程序在本地主机上运行,​​而且在ceemee11111.appspot.com中也没有错误。 作为测试我注释掉“进口webapp2的”,并再次尝试,得到了一个错误 “无模块命名google.appengine.ext”

请一些想法

一个应用

回答

1

看来python无法找到库,所以

  • 你在系统中安装了webapp2吗?您可以尝试使用“pip install webapp2”或“easy_install”

  • 如果它们仍然丢失,也许应该检查您的“PYTHONPATH”变量,以检查python在哪里寻找库,然后将其添加到路径。

+0

我想如果应用程序在localhost和appspot.com上工作,模块可用。 webapp2不在python的可用模块中,所以我将尝试安装它。 –

+0

我已经在python模块中安装了webapp2并再次运行import helloworld并获得“导入错误:没有名为webob的模块” –

+0

这对于基本过程来说似乎非常复杂。我所需要的是将put()和fetch()访问权限存取到Google数据存储区以获取和检索数据。有没有更简单的方法来做到这一点。 –