Skip to content

AttributeError: module 'grpc.experimental.aio' has no attribute 'StreamUnaryCall' #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
e-baumer opened this issue Jun 16, 2021 · 1 comment

Comments

@e-baumer
Copy link

While trying to import documentai_v1beta3 from google.cloud I get the following error:
AttributeError: module 'grpc.experimental.aio' has no attribute 'StreamUnaryCall'

Environment details

  • OS type and version: Ubuntu 20.04.2 LTS
  • Python version: 3.8.5
  • pip version: pip --version
  • google-api-core version: 1.22.2

Steps to reproduce

  1. from google.cloud import documentai_v1beta3

Code example

from google.cloud import documentai_v1beta3

Stack trace

----> 1 from google.cloud import documentai_v1beta3

/usr/local/lib/python3.8/dist-packages/google/cloud/documentai_v1beta3/__init__.py in <module>
     16 #
     17 
---> 18 from .services.document_processor_service import DocumentProcessorServiceClient
     19 from .types.document import Document
     20 from .types.document_processor_service import BatchProcessMetadata

/usr/local/lib/python3.8/dist-packages/google/cloud/documentai_v1beta3/services/document_processor_service/__init__.py in <module>
     16 #
     17 
---> 18 from .client import DocumentProcessorServiceClient
     19 from .async_client import DocumentProcessorServiceAsyncClient
     20 

/usr/local/lib/python3.8/dist-packages/google/cloud/documentai_v1beta3/services/document_processor_service/client.py in <module>
     25 from google.api_core import client_options as client_options_lib  # type: ignore
     26 from google.api_core import exceptions  # type: ignore
---> 27 from google.api_core import gapic_v1  # type: ignore
     28 from google.api_core import retry as retries  # type: ignore
     29 from google.auth import credentials  # type: ignore

/usr/local/lib/python3.8/dist-packages/google/api_core/gapic_v1/__init__.py in <module>
     24 if sys.version_info >= (3, 6):
     25     from google.api_core.gapic_v1 import config_async  # noqa: F401
---> 26     from google.api_core.gapic_v1 import method_async  # noqa: F401
     27     __all__.append("config_async")
     28     __all__.append("method_async")

/usr/local/lib/python3.8/dist-packages/google/api_core/gapic_v1/method_async.py in <module>
     18 """
     19 
---> 20 from google.api_core import general_helpers, grpc_helpers_async
     21 from google.api_core.gapic_v1 import client_info
     22 from google.api_core.gapic_v1.method import (_GapicCallable,  # noqa: F401

/usr/local/lib/python3.8/dist-packages/google/api_core/grpc_helpers_async.py in <module>
    143 
    144 
--> 145 class _WrappedStreamUnaryCall(_WrappedUnaryResponseMixin, _WrappedStreamRequestMixin, aio.StreamUnaryCall):
    146     """Wrapped StreamUnaryCall to map exceptions."""
    147 

AttributeError: module 'grpc.experimental.aio' has no attribute 'StreamUnaryCall'
> /usr/local/lib/python3.8/dist-packages/google/api_core/grpc_helpers_async.py(145)<module>()
    143 
    144 
--> 145 class _WrappedStreamUnaryCall(_WrappedUnaryResponseMixin, _WrappedStreamRequestMixin, aio.StreamUnaryCall):
    146     """Wrapped StreamUnaryCall to map exceptions."""
    147 

Thanks!

@e-baumer
Copy link
Author

This was solved by upgrading grpcio to 1.38.0. Apologies, I should have read #40 more closely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant