Skip to content

How do I compile a shared library to be used with ctypes on mesonpy? #573

Answered by rgommers
peppedilillo asked this question in Q&A
Discussion options

You must be logged in to vote

One could come up with tricks to get around this (for example messing with Path or using sys.executable to get the python installation folder)

You'll want to look into how regular Python packages work. You should have wrapper.py and an __init__.py right next to your shared library if you install to site-packages. And then you use it via an import statement, not via running python wrapper.py.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@dnicolodi
Comment options

Comment options

You must be logged in to vote
6 replies
@peppedilillo
Comment options

@rgommers
Comment options

@peppedilillo
Comment options

@rgommers
Comment options

Answer selected by peppedilillo
@peppedilillo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants