I'm trying to invoke protoc within my python script. I am trying to use the 
grpc.tools.protoc.main() function within my script (the main function takes 
a list of the command line arguments as input).  However, the function call 
fails when the .proto file is referenced using an absolute or relative 
path, usually with the error:

You must specify a --proto_path which encompasses this file.  Note that the 
> proto_path must be an exact prefix of the .proto file names -- protoc is 
> too dumb to figure out when two paths (e.g. absolute and relative) are 
> equivalent (it's harder than you think)
>

However, when calling protoc from the command line as a module as "python3 
-m grpc_tools.protoc" with the same arguments, it works in the expected 
way.  Any reason this could be happening? I am thinking it has to do with 
environment variables, but not quite sure.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/d5fd222c-c355-4ab1-8855-44d23233d654o%40googlegroups.com.

Reply via email to