-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Python can't find DLL when linking external C library (gtstreamer) on Windows #1937
Comments
Looks like Python is not automatically searching $PATH from v3.8 onwards, it works if you use |
How should |
Good queston. I'm still not sure why it just works on MacOS. for context: https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew |
IMHO, for security it should be left for the library/user to call |
What are the security implications you're worried about? IMHO this is the standard for system-wide dynamic DLLs and most Python modules that present bindings to C libs will search So there needs to be some sort of way to either tell |
The doc says:
If there isn't any security implication, you'd want python to handle it automatically, right? Anyway, I suggest you use a mixed Python/Rust project layout and add |
Thats probbaly the way to go, thanks! Maybe worth documenting as the standard error when trying to import on Windows is not very helpful. |
Bug Description
Hey, I really like maturin/PyO3 and I've been using it for a project linking gstreamer. I'm now testing my package on Windows (was using MacOS before) and I'm running into a problem with Python unable to find DLLs.
A simple example repo can be found here: https://github.com/marcpabst/webcam-py
Importing the created python package (
maturin develop
) works fine on MacOS but fails on Windows withImportError: DLL load failed while importing webcam_py: The specified module could not be found.
. It works when I manually copy the gstreamer DLLs to tgesite-packages
folder, but that seems to break internal linking within gstreamer.Any pointers?
Your maturin version (
maturin --version
)1.4.0
Your Python version (
python -V
)Python
Your pip version (
pip -V
)3.8.0
What bindings you're using
pyo3
Does
cargo build
work?If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash
/
)?Steps to Reproduce
maturin develop
import webcam_py
ImportError: DLL load failed while importing webcam_py: The specified module could not be found.
The text was updated successfully, but these errors were encountered: