Search code examples
python-3.xgrpc-python

grpc_tools did not create xxx_grpc.py


I am learning grpc, but encounter an issue.

  1. create proto file as showing below (test.proto)
  2. run python3 -m grpc_tools.protoc -I ./protos --python_out=. ./protos/test.proto

expect to have two files: test_pb2.py and test_pb2_grpc.py

but only have test_pb2.py

I am not sure which step I am missing.

syntax = "proto3";

service PingPongService{
    rpc ping(Ping) returns (Pong){}
}

message Ping{
    int32 count = 1;
}

message Pong{
    int32 count = 2;
}

Solution

  • it seems the following arg needs to be added

      --grpc_python_out=.