0

According to this http://www.grpc.io/docs/tutorials/basic/python.html#creating-the-server and the examples here https://github.com/grpc/grpc/tree/v1.0.0/examples/python/route_guide, when I generate my _pb2.py file, several classes named *Stub and *Servicer should be created. However, my generated _pb2.py file doesn't contain anything like this.

This is how I generate my _pb2.py file:

protoc --proto_path=.venv/lib/python3.5/site-packages/grpc/tools/_proto/ --proto_path=.  --python_out=voyager/ voyager.proto

Is there something special about proto3 that means that these classes aren't generated? Or a protoc flag that I'm missing? I can't seem to figure out how to create a gRPC server.

1 Answer 1

2

It looks like you are missing --grpc_python_out=voyager/. There are two plugins involved: Protobuf Python and gRPC Python. You are only running the Protobuf one.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.