vfx-rs / openexr-rs

BSD 3-Clause "New" or "Revised" License
11 stars 0 forks source link

PyO3 Python extension missing dlls #4

Open Design0r opened 11 months ago

Design0r commented 11 months ago

Hi, im trying to make a simple python extension using maturin and the PyO3 bindings.

The Program loads an .exr file and saves it as a .jpg and its working fine as a standalone tool. So i used maturin to create a python extension and when I try to import this extension in a python script i get following error:

“ImportError: Dll Load Failed: The specified module could not be found”.

I inspected the generated .pyd file with Dependency Walker and found it had issues finding a "OPENEXR-C-0_10-SHARED.DLL". I have honestly no Idea where to get this file from as i cant find it in the prebuilt openexr release in the target folder of my rust project.

Any tips would be greatly appreciated

scott-wilson commented 11 months ago

The OpenEXR bindings are still in a huge state of flux. Chances are they'll be rewritten so they use CXX. But, if all you're after are Python bindings and image IO, have you looked into OpenImageIO?

Design0r commented 11 months ago

thanks for the quick answer. My current solution uses the OpenImageIO Python bindings. I mainly wanted to learn a bit of rust and so i thought i could try out the rust bindings for openEXR and make an extension for a python tool im working on

scott-wilson commented 11 months ago

No worries! We're making some progress with the OpenImageIO Rust bindings. If you're interested, we could use some support. https://github.com/vfx-rs/oiio-bind

Design0r commented 11 months ago

I would love to contribute, but I'm afraid I wouldn't be much help since I'm not a C++ person and only recently started picking up Rust.

scott-wilson commented 11 months ago

Sounds like a great time to learn. ;)

If you're interested, I think it might be a good idea to set up a Zoom call and go over creating a binding. I recommend going to the #rust channel in the ASWF Slack (join here: https://slack.aswf.io/), and I will set up a demo for maybe next week or so.