从Python连接到google数据存储
可能重复:从Python连接到google数据存储,python,export,google-cloud-datastore,Python,Export,Google Cloud Datastore,可能重复: 我正在学习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 im
我正在学习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)
在pythonshelli中,chdir到helloworld
导入helloworld
并获取导入错误“没有名为webapp2的模块”
该应用程序在localhost和ceemee1111.appspot.com中运行,没有错误。
作为一个测试,我注释掉了“importwebapp2”,然后再试一次,结果出现了一个错误
“没有名为google.appengine.ext的模块”
请提出一些想法
丹
applicatonpython似乎找不到库,所以
- 系统中是否安装了webapp2?。您可以尝试使用“pip安装webapp2”或“轻松安装”
- 如果它们仍然丢失,也许您应该检查“PYTHONPATH”变量,以检查python在哪里查找库,并将您的添加到路径中
- 系统中是否安装了webapp2?。您可以尝试使用“pip安装webapp2”或“轻松安装”
- 如果它们仍然丢失,也许您应该检查“PYTHONPATH”变量,以检查python在哪里查找库,并将您的添加到路径中