我正試圖在谷歌應用引擎上使用客戶端和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?
謝謝!