AttributeError:模块“grpc.experimental.aio”没有属性“StreamUnaryCall”Google NLP API

2024-06-08 03:57:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我想从Google NLP API运行脚本:

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

我得到以下错误:

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

有什么帮助吗?谢谢大家!


Tags: inpyapibingooglelinelibraryframework

热门问题