- Notifications
You must be signed in to change notification settings - Fork82
Ctypes and editable mode#653
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Dears. Using The If you want to take a look,here is the software I'm working on. The problem is that, once in editable mode, the code looks for the shared libraries in the wrong place. While not in editable mode, the libraries are installed in my local environment directory ( I have asked this question under an issue (sorry@rgommers for reviving a dead issue) and got a kindreply from@eli-schwartz, which suggested to install the shared libraries in multiple places, so that I can try to import from these. However it is not fully clear to me how this should be carried out, and if there is any better solution not requiring multiple copies of the same file. Is it possible to install my project in editable mode? Thank you very much. |
BetaWas this translation helpful?Give feedback.
All reactions
I think the trick here is to useimportlib.resources instead of__file__:
importlib.resources.files(__package__).joinpath(".sharedlibs/libp-focus.so")
meson-python's editable-mode hooks will resolve that to the build directory.
Replies: 2 comments 2 replies
-
I think the trick here is to useimportlib.resources instead of importlib.resources.files(__package__).joinpath(".sharedlibs/libp-focus.so") meson-python's editable-mode hooks will resolve that to the build directory. |
BetaWas this translation helpful?Give feedback.
All reactions
-
importlib-resources is totally unrelated to the challenges of finding files in an editable install, using a different source/build layout than a "real" install would have. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I don't think it is, this answer looks correct to me. The editable install works through |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I think I had suggested at the time, not that you install the libraries in multiple places, but rather that your The library is created in You look for the library in That means that the library itself may be in one of two places:
The trick is going to be locating |
BetaWas this translation helpful?Give feedback.