Skip to content

fix: fix import on windows #7

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

Closed
wants to merge 5 commits into from

Conversation

tlambert03
Copy link
Member

the package isn't currently working on windows unless you first import PyQt6, which calls os.add_dll_directory. This PR just imports PyQt6 first manually, (so that it can add the dll directory)

@char101
Copy link
Contributor

char101 commented Mar 8, 2025

You can't fix it that way because dll dependencies are resolved before the dll init method is run

import pyqtads -> loads pyqtads.pyd -> windows dll loader loads the dll -> try to find the dependencies (qt dlls) -> failed

What you can do is rename pyqtads.pyd to _pyqtads.pyd and then create a wrapper module which contains

import PyQt6
from _pyqtads import *

@tlambert03
Copy link
Member Author

You can't fix it that way because dll dependencies are resolved before the dll init method is run

Thanks, I realized that, and then stopped updating this branch and started playing with the approach we discussed elsewhere: either putting it under Pyqt6, or having an additional importer module.

I just stopped pushing here while I decide what I’d like to do.

@tlambert03 tlambert03 closed this Mar 8, 2025
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

Successfully merging this pull request may close these issues.

2 participants