No module error for python generated grpc script

I am a new python programmer. We are currently switching from python2 to python3, and we have found that all the python script generated by grpc has this code.

import dataPlatform_pb2 as dataPlatform__pb2

However, python3 does not support this type of relative path import. I need to manually change it to

from . import dataPlatform_pb as dataPlatform__pb2

Is there a better solution to this problem, it seems like bad practice is constantly changing automatically generated code.

+4
source share
1 answer

, - . , , , . , , .

, . nonce ().

+1

Source: https://habr.com/ru/post/1676722/