On Oct 28, 2:40 pm, "Kenton Varda" <
ken...@google.com> wrote:
> The model used by the protocol compiler is to assume that the .proto files
> are located in a tree that parallels the Python package tree. We don't want
> to get into relative imports because they can get complicated and
> error-prone.
> If you don't want to put your .proto files into a tree matching your Python
> package tree, you could alternatively map them into such a tree virtually
> like so:
>
> protoc --proto_path=mypkg=proto
>
> This maps the virtual directory "mypkg" to the physical directory "proto".
> You would then have to write your imports like:
>
> import "mypkg/a.proto"
>
> You can also map individual files.
>
> If this is insufficient then I guess we need a way to specify the python
> package explicitly in the .proto file, similar to the java_package option,
> rather than just inferring it from the location of the .proto file.
>