当我尝试使用以下命令生成文件时:
python -m grpc_tools.protoc -I./ --python_out=. --grpc_python_out=. service.proto
我遇到了错误。
Traceback:
test_client.py:11: in <module>
from tests.remote.grpc_wrapper.service_pb2_grpc import TestServiceServicer, add_TestServiceServicer_to_server, \
service_pb2_grpc.py:4: in <module>
import service_pb2 as service__pb2
E ModuleNotFoundError: No module named 'service_pb2'
我该怎么解决这个问题?我尝试重新安装protobuf,但没有帮助。
pip uninstall protobuf
pip install -U protobuf
顺便说一句,我使用conda,我试图使用
conda install protobuf
但是它对我没有帮助。
service_pb2
,没有模块。请安装它。 - sahasrara62