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

ModuleNotFoundError: No module named 'Windows' #13

Open
ElTentakel opened this issue Apr 30, 2020 · 3 comments
Open

ModuleNotFoundError: No module named 'Windows' #13

ElTentakel opened this issue Apr 30, 2020 · 3 comments

Comments

@ElTentakel
Copy link

I just did a clean installation of Python 32bit and Bricknil under Windows 10 1903:

pip install bricknil
...
'Successfully installed bluebrick-Adafruit-BluefruitLE-0.9.13 bricknil-0.9.3 bricknil-bleak-0.3.1 curio-1.2 future-0.18.2 pythonnet-2.4.0 pyyaml-5.3.1'

and tried this sample:

from curio import sleep
from bricknil import attach, start
from bricknil.hub import PoweredUpHub
from bricknil.sensor import TrainMotor

@attach(TrainMotor, name='motor')
class Train(PoweredUpHub):
    
    async def run(self):
        for i in range(2):  # Repeat this control two times
            await self.motor.ramp_speed(80,5000) # Ramp speed to 80 over 5 seconds
            await sleep(6)
            await self.motor.ramp_speed(0,1000)  # Brake to 0 over 1 second
            await sleep(2)

async def system():
    hub = Train("My train", ble_id="90:84:2B:03:xx:xx")

if __name__ == '__main__':
    start(system)

and it didn't work:

Type "help", "copyright", "credits" or "license()" for more information.
>>> 
============= RESTART: C:\Users\User\Desktop\Bricknil\bricktest.py ============
Traceback (most recent call last):
  File "C:\Users\User\Desktop\Bricknil\bricktest.py", line 20, in <module>
    start(system)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\bricknil\bricknil.py", line 207, in start
    from .bleak_interface import Bleak
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\bricknil\bleak_interface.py", line 20, in <module>
    import bleak
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\bleak\__init__.py", line 68, in <module>
    from bleak.backends.dotnet.discovery import discover  # noqa
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\bleak\backends\dotnet\discovery.py", line 17, in <module>
    from Windows.Devices.Bluetooth.Advertisement import BluetoothLEAdvertisementWatcher
ModuleNotFoundError: No module named 'Windows'
>>> 
```
@joosbuijsNL
Copy link

+1

I am also trying to run bricknil on Windows 10 but get this error message. Looking forward to a solution or hint!

@BuongiornoTexas
Copy link

I was able to do a quick fix for based on hbldh/bleak#53 (comment). (I'm assuming #19 is a better long term fix though)

@Sebwap
Copy link

Sebwap commented Sep 30, 2021

Work for me too, :)
But why using a so old version of Bleak ?

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

4 participants