我正试图在谷歌应用引擎上使用客户端和gcloud桶。 首先,我安装gcloud。如何在谷歌应用引擎上使用gcloud?
pip install gcloud -t my_project_directory
其次,我开始导入gcloud并使用它。这里是我的代码:
from gcloud import storage
class printstr(webapp2.RequestHandler):
def get(self):
self.response.out.write("YA")
config = {}
config['webapp2_extras.sessions'] = {
'secret_key': 'my-super-secret-key',
}
app = webapp2.WSGIApplication([('/back/printstr', printstr),
], debug=True, config=config)
当我打开地址(本地主机:8080 /后退/ printstr),我应该看到 “YA” 的页面上。但我得到的HTTP错误500,我看到日志:
from google.protobuf import timestamp_pb2
ImportError: No module named protobuf
我敢肯定有在谷歌(文件夹)一个protobuf的(文件夹),并有一个timestamp_pb2.py在protobuf的(文件夹)。但是,我不知道为什么我会得到这个错误?我应该如何使用gcloud?
谢谢!