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

How to compile the capnp schema file to py? #276

Open
Lemac opened this issue Oct 25, 2021 · 3 comments
Open

How to compile the capnp schema file to py? #276

Lemac opened this issue Oct 25, 2021 · 3 comments

Comments

@Lemac
Copy link

Lemac commented Oct 25, 2021

I got a schema file in capnp language.
But I don't know how to compile it to python file like what I did in C++.

@haata
Copy link
Collaborator

haata commented Oct 25, 2021

pycapnp uses import hooks to compile the .capnp files at runtime.

import capnp # Must be imported first to install the import hooks

import mycapnpfile_capnp # Import your capnp files, notice the _capnp, that corresponds to the .capnp file extension

Also see: https://github.com/capnproto/pycapnp/blob/master/examples/addressbook.py

@madhavajay
Copy link
Contributor

😲 cool

@loloxwg
Copy link

loloxwg commented Nov 11, 2023

ModuleNotFoundError: No module named 'capnp.lib.capnp'

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

4 participants