kevincar / bless

Cross-platform Bluetooth Low Energy Server Python Library
MIT License
78 stars 26 forks source link

no module error pysetupdi #105

Open h-enes-simsek opened 1 year ago

h-enes-simsek commented 1 year ago

The problem

I tried to run the server.py and got the following error:

(VENV) redacted>python server.py
Traceback (most recent call last):
  File "redacted\Desktop\bluetoothTest\server.py", line 12, in <module>
    from bless import (  # type: ignore
  File "redacted\Desktop\bluetoothTest\bless\VENV\lib\site-packages\bless\__init__.py", line 41, in <module>
    from bless.backends.winrt.server import (  # noqa: F401
  File "redacted\Desktop\bluetoothTest\bless\VENV\lib\site-packages\bless\backends\winrt\server.py", line 20, in <module>
    from bless.backends.winrt.ble import BLEAdapter
  File "redacted\Desktop\bluetoothTest\bless\VENV\lib\site-packages\bless\backends\winrt\ble\__init__.py", line 1, in <module>
    from .adapter import BLEAdapter
  File "redacted\Desktop\bluetoothTest\bless\VENV\lib\site-packages\bless\backends\winrt\ble\adapter.py", line 5, in <module>
    from pysetupdi import devices  # type: ignore

Reproduction

I created a new venv pip install bleak pip install bless python server.py

Desktop (please complete the following information): Win10

Additional context There is no lib called pysetupdi in PYPI, did you install it manually?

aahmed7 commented 1 year ago

pysetupdi is not available on pypi and needs to be installed manually from https://github.com/gwangyi/pysetupdi

clone the repo and run the following command:

python .\setup.py install
h-enes-simsek commented 1 year ago

Thank you for your reply. I think it would be helpful to have your answer in the readme file.

kevincar commented 1 year ago

Thanks for bringing this up. I'm going to keep this open for my records to remind me to update the code. As @h-enes-simsek pointed out, this should either be in the readme or ideally I'll update the setup.py to ensure this is installed during pip install on windows OS.

NotLawson commented 2 weeks ago

If you run pip install git+https://github.com/gwangyi/pysetupdi it clones and installs in one command.