首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >AttributeError:模块'grpc.experimental.aio‘没有属性'StreamUnaryCall’- Google NLP API

AttributeError:模块'grpc.experimental.aio‘没有属性'StreamUnaryCall’- Google NLP API
EN

Stack Overflow用户
提问于 2020-09-14 09:00:51
回答 1查看 761关注 0票数 0

我想从Google NLP API运行该脚本:

https://cloud.google.com/natural-language/docs/analyzing-entities

我得到了以下错误:

代码语言:javascript
运行
复制
Traceback (most recent call last):
  File "/Users/myuser/Desktop/g.py", line 1, in <module>
    from google.cloud import language_v1
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/google/cloud/language_v1/__init__.py", line 19, in <module>
    from google.cloud.language_v1.gapic import language_service_client
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/google/cloud/language_v1/gapic/language_service_client.py", line 24, in <module>
    import google.api_core.gapic_v1.client_info
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/google/api_core/gapic_v1/__init__.py", line 26, in <module>
    from google.api_core.gapic_v1 import method_async  # noqa: F401
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/google/api_core/gapic_v1/method_async.py", line 20, in <module>
    from google.api_core import general_helpers, grpc_helpers_async
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/google/api_core/grpc_helpers_async.py", line 145, in <module>
    class _WrappedStreamUnaryCall(_WrappedUnaryResponseMixin, _WrappedStreamRequestMixin, aio.StreamUnaryCall):
AttributeError: module 'grpc.experimental.aio' has no attribute 'StreamUnaryCall'
[Finished in 1.6s with exit code 1]
[cmd: ['/Library/Frameworks/Python.framework/Versions/3.8/bin/python3', '-u', '/Users/myuser/Desktop/g.py']]
[dir: /Users/myuser/Desktop]
[path: /Users/myuser/opt/miniconda3/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin]

我还意识到它在路径" miniconda3“中显示,但我已经卸载了miniconda3。

有什么帮助吗?谢谢!

EN

回答 1

Stack Overflow用户

发布于 2020-09-14 12:18:45

我在库https://pypi.org/project/grpcio/的一个错误中意识到了这一点

要解决此问题,您需要安装最新版本:

pip3安装grpcio==1.32.0

您就完成了:)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63876922

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档