I took a stab at answering your question on Stack overflow:
https://stackoverflow.com/a/77115927/609290
On Thursday, September 14, 2023 at 9:31:25 PM UTC-7 Charlie Tian wrote:
> My directory structure is as follows:
>
> |-test.py
> |-test.proto
> |-test_pb2.py
> |-__init__.py
> |-comm
> |-comm.proto
> |-comm_pb2.py
> |-__init__.py
>
> both \_\_init__.py is empty
> and **test.proto** is like this:
>
> package test;
> import "comm/comm.proto";
>
> message Test{
> optional comm.Foo foo = 1;
> }
> and **comm.proto** is like this:
>
> package comm;
>
> message Foo{}
>
> i successfuly used command *protoc --python_out=. -I.* to compile
> **comm.proto** and **test.proto**
> but when i tried to import ***test_pb2*** in ***test.py***, i encounter
> this error
>
> TypeError: Couldn't build proto file into descriptor pool: Depends on
> file 'comm/comm.proto', but it has not been loaded
>
>
> Can someone help me identify the reason and provide a solution, please?
>
--
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/dd328d73-0721-4857-afff-8371e541305dn%40googlegroups.com.