【问题标题】:Can Google Cloud Endpoints work with Text To Speech?Google Cloud Endpoints 可以与文本转语音一起使用吗?
【发布时间】: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-endpointsgoogle-endpoints-api-managementgoogle-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


    【解决方案1】:

    These client libraries do not work with the first-generation Python 2.7 runtime, and there are no plans to support them.

    您将需要改用新的第二代 Python 3.7 运行时,它可以让您安装任意依赖项。详情请参阅“Python 3 Runtime Environment”。

    【讨论】:

      【解决方案2】:

      我认为答案是 Google Cloud 客户端库尚不兼容 Google App Engine。我在尝试在 GAE 应用程序中使用 Text To Speech 时遇到的问题仍然存在,即使它在 GAE 应用程序之外的本地运行小测试时运行良好。

      可以在此处跟踪此问题: https://github.com/googleapis/google-cloud-python/issues/1893

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-06-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-01-27
        相关资源
        最近更新 更多