Hello,
I am working in Python.
I have a proto file in PACKAGE_A that I am trying to import into
PACKAGE_B. Package_A is installed via pip install, so it live in the
*site_packages* of the venv.
Package_B's proto file includes the *import "package_a/package_a.proto"* at
the top of the file.
When I use protoc to compile Package_B's grpc & pb2 files it all works
fine, but when I try running Package_B, I get the following error:
ImportError while loading conftest.py
pacakge_b/src/package_b.py:18: in <module>
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
E TypeError: Couldn't build proto file into descriptor pool!
E Invalid proto descriptor for file "package_b.proto":
E package_a/protos/package_a.proto: Import
"package_a/protos/package_a.proto" has not been loaded.
E package_b.Message.foo: "foo" seems to be defined in
"package_a.proto", which is not imported by "package_b.proto". To use it
here, please add the necessary import.
I've read a lot of documentation about relative vs. absolute paths, but
seems everything I have tried with generating new files isn't working. I'm
trying to leverage building packages and then importing only what's needed
for each other package.
Any suggestions would be welcome, and hope all have a great holiday.
Best,
Brad
--
You received this message because you are subscribed to the Google Groups
"grpc.io" 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/grpc-io/3e1a974e-cb0a-4a45-b067-de548471fee3n%40googlegroups.com.