Skip to content
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

ImportError: DLL load failed while importing _winrt_windows_devices_bluetooth #86

Open
waynieoaks opened this issue Apr 3, 2024 · 4 comments

Comments

@waynieoaks
Copy link

waynieoaks commented Apr 3, 2024

Hello

Not having an issue on Windows 10, but on Windows 11 I am seeing the following:

ImportError: DLL load failed while importing _winrt_windows_devices_bluetooth: The specified module could not be found.

I have installed Python 3.12 and bleak - this happens in http mode when trying to discover lights. I have tried googling the issue and am told to use os.add_dll_directory but still struggling to get this working.

EDIT: I see in issue #44 that this is a Windows 11 issue. I could rollback to Windows 10 but I know it would be a short term solution until Windows 10 reaches end of life. I am happy to play guinea pig if it helps resolve in general - although I am not python savvy so may not be the best of help.

Many thanks.

@taburineagle
Copy link
Owner

Hi @waynieoaks - hmm...

I'm curious, I have Windows 11 on my laptop and everything seems to work fine, but I have to check into which versions of Python, bleak, etc. I'm running, as I don't have the laptop with me at the moment. I think I have Python 3.10.xx, as I recall PySide2 not working with later versions the last time I checked into updating Python on the system I was on. Are you using the latest commit of NeewerLite-Python, or one of the older releases?

@waynieoaks
Copy link
Author

Hi,

Using the latest release 0.12d. When I get home tonight I could try and roll back Python to 3.10 and see if that makes a difference? The other option is rolling my OS to Windows 10 but this will fix for me but not the overall issue :-)

What I did was install Python 3.12
pip3 install bleak
Run script with --http
Error on trying to discover lights

As you said, PySide2 not working but this is all for automation so not an issue for me

Many thanks.

@waynieoaks
Copy link
Author

Confirmed:
Issue seems to be isolated to Python 3.12 on Windows 11.

Uninstalling and installing Python 3.10 fixed the issue for me - and to be 100% sure I did it with Python 3.11
It does just seem to be something in 3.12 in Windows 11.

@taburineagle
Copy link
Owner

Interesting - I'm curious why that is though, Python 3.12 must have a different set of dependencies than 3.11 does... I'll have to check into that when I have some time!

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

No branches or pull requests

2 participants