6

I just want to complete a simple demo, but I got this error message.

Traceback (most recent call last):
  File "E:/grpc/biliService.py", line 10, in <module>
    import hello_bilibili_pb2 as pb2
  File "E:\grpc\hello_bilibili_pb2.py", line 21, in <module>
    _HELLODEWEIREQ = DESCRIPTOR.message_types_by_name['HelloDeweiReq']
AttributeError: 'NoneType' object has no attribute 'message_types_by_name'
karel
  • 5,489
  • 46
  • 45
  • 50
guandong lan
  • 61
  • 1
  • 2

1 Answers1

1
grpcio==1.30.0
grpcio-tools==1.30.0

The latest grpcio version 1.44.0 generate incompatible pb2 files, so I've seen the same question, I downgrade grpcio 1.30.0, and it worked.

Javad
  • 2,033
  • 3
  • 13
  • 23
zwong
  • 21
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 21 '22 at 12:11
  • I wasn't able to run this inside docker for these versions for some reason – Yago Dórea Jul 24 '23 at 21:08