Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #32 (gRPCAlchemy can't import generated proto files on Windows) not fully solved. #36

Closed
eric-peacock opened this issue Oct 26, 2020 · 1 comment

Comments

@eric-peacock
Copy link

  • gRPCAlchemy version: 0.6.1
  • Python version: 3.7.6
  • Operating System: Windows

Description

I believe the windows issue #32 is still present in server.py on lines 192 and 195. gRPCAlchemy can't import generated proto files on Windows, see this error:

ModuleNotFoundError: No module named 'protos\hellomessage_pb2'

It looks to me like the fix applied to utils.py will do the trick for server.py. I will try to PR a fix asap, but wanted to let you know in the meantime.

f"{os.path.join(self.config.PROTO_TEMPLATE_ROOT, self.config.PROTO_TEMPLATE_PATH, bp.access_file_name()).replace('/', '.')}_pb2_grpc"

Proposed fix, use:

if sys.platform == "win32":
    FILE_SEPARATOR = "\\"
else:
    FILE_SEPARATOR = "/"

This problem doesn't exist using linux. Thank you for this excellent library btw.

@GuangTianLi
Copy link
Owner

fixed in 0.6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants