【发布时间】:2019-02-10 02:34:02
【问题描述】:
我试图通过在 GAE Python 2.7 中运行 UI,然后将 OpenAPI 部署到也使用 Python 2.7 的 Cloud Endpoints 来使我的 Google Cloud 项目以 App Engine (GAE) 标准环境为中心。我希望我的 API 能够检查 Google Cloud Storage (GCS) 中的文件,然后如果它不存在,则从 Datastore 中获取实体,使用 Text- 处理一些数据 to-Speech,然后将生成的 mp3 保存到 GCS。
在 Python 2.7 下,I need to use the old (2015)cloudstorage 客户端库、google-endpoints、google-endpoints-api-management 和 google-cloud-texttospeech 模块,都在我的 ./lib 文件夹中。
安装这些模块后,我可以毫无问题地运行"echo" demo project。这表明不存在依赖版本冲突。但是,当尝试使用 texttospeech 时,我收到此错误:
ImportError: 没有名为 grpc._cython.cygrpc 的模块
为了解决这个问题,我将以下内容添加到 app.yaml 的 libraries 部分:
- name: grpcio
version: latest
然后我得到这个错误:
from six.moves import http_client
ImportError: No module named moves
我尝试类似地修复它,但错误仍然存在
- name: six
version: latest
Other solutions 没有帮助。 six 1.12.0 安装在 ./lib 中,1.11.0 附带最新的gcloud cloud SDK (233.0.0)。
如何将文本转语音与 Cloud Endpoints 结合使用?即使我得到这个工作,我可以期望它与 GCS 和 Datastore 一起工作吗?到目前为止,在 GAE 下使用 Flask-RESTful 似乎更容易。
【问题讨论】:
标签: python google-app-engine google-cloud-platform google-cloud-storage google-text-to-speech