【问题标题】:Google Cloud Import Statement not working谷歌云导入声明不起作用
【发布时间】:2021-02-18 14:38:31
【问题描述】:

我是新手,正在尝试将语音转换为文本。为此,我正在尝试在 Python 3.9/PyCharm 社区版中编写一段代码。

我尝试编写此声明(来自 google.cloud 导入演讲)。但是它不识别 google.cloud。它说“未解决的参考谷歌”。

我确实使用命令“pip install google-cloud”安装了“google.cloud”。但是没有成功。

知道如何解决这个问题吗?

谢谢 迪帕克

【问题讨论】:

  • 使用import google-cloud-speech。软件包 google-cloud 自 2018 年 6 月 18 日起已弃用,不应使用。这是支持的 Python 包的链接:github.com/googleapis/…
  • 不起作用...
  • 对不起。错字:import google.cloud.speech。您需要先安装软件包:pip install google-cloud-speech.
  • 还是不行。 (import google.cloud.speech) 中的 google 显示红色下划线。
  • Python 的错误消息相当不错。使用pip freeze 的结果、python 版本和错误消息编辑您的问题。

标签: google-cloud-platform speech


【解决方案1】:

我遇到了同样的问题

from google.cloud import storage

阅读上面的建议,我解决了在 PyCharm 中安装 google-cloud-storage 包的问题(安装了很多依赖包)。 然后我在

中更改了该导入
from google.cloud.storage import client

Client 是我需要的类。

大卫

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-18
    • 1970-01-01
    • 2020-06-28
    • 2017-11-25
    • 1970-01-01
    • 2019-05-02
    • 1970-01-01
    相关资源
    最近更新 更多