Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Update to account for import error in generated python code #671

Merged
merged 2 commits into from
Jun 18, 2018

Conversation

dray92
Copy link

@dray92 dray92 commented May 29, 2018

After generating relevant server/client code for python, the presence of

from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2

causes,

    from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
ImportError: No module named api

pip install grpcio-tools only brings in google/protobuf module.

Installing googleapis-common-protos causes the required files, specifically,
google/api/annotations_pb2.py to be pulled in, thus resolving the import error.

There are examples like python-grpc-hack.sh out there, which is basically hacking
around the absence of the required module. I have not yet tried the Java codegen yet
but till the relevant protoc changes are pushed upstream, this change seems to be
the path of least resistance.
What are your thoughts around this?

Related issue: #298.

Signed-off-by: Debosmit Ray [email protected]

@thelinuxfoundation
Copy link

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@hsaliak
Copy link

hsaliak commented Jun 15, 2018

@debosmit would you be OK with signing the CLA? without it, we cannot merge the PR.

@hsaliak
Copy link

hsaliak commented Jun 18, 2018

Thank you for the contribution!

@hsaliak hsaliak merged commit efe9382 into grpc:master Jun 18, 2018
@dray92 dray92 deleted the python_doc_update branch June 28, 2018 06:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants