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

Not compatible with M1 MacBook? #469

Open
slerman12 opened this issue Feb 2, 2023 · 7 comments
Open

Not compatible with M1 MacBook? #469

slerman12 opened this issue Feb 2, 2023 · 7 comments

Comments

@slerman12
Copy link

I installed pybluez and get this error when trying to import on an M1 MacBook:

import bluetooth
  File "/Users/samlerman/Code/miniforge3/lib/python3.9/site-packages/bluetooth/__init__.py", line 47, in <module>
    from .macos import *
  File "/Users/samlerman/Code/miniforge3/lib/python3.9/site-packages/bluetooth/macos.py", line 1, in <module>
    import lightblue
ModuleNotFoundError: No module named 'lightblue'
@medukonis
Copy link

Same issue on M2 MacBook Pro. MacOS Ventura

@zakutnya
Copy link

zakutnya commented Mar 20, 2023

It's not about M1/2, it's about macOS. At least i just came up with the same ModuleNotFoundError: No module named 'lightblue' on Intel MacBook Pro.

The solution was incredibly simple:

pip install python-lightblue

Sadly, that hasn't helped me in general, eg.:
i use bluetooth.lookup_name() that perfectly does it's job on Linux, but just prints out TODO: implement on macOS 😐

@Alexandro1112
Copy link

I same working on Mac Book M1, and I installed pyobjc, and Bluetooth modules.

@vladRudenua23
Copy link

any updates ?

@jdcrunchman
Copy link

When will there be updates...
I still did: pip install python-lightblue

I'm running on an M1 Mac. I really need this working.... this is driving me crazy...

Here's the source code.......

import bluetooth

def discover_devices():
print("Discovering nearby devices:")
nearby_devices = bluetooth.discover_devices(duration=8, lookup_names=True, lookup_class=True, flush_cache=True)

for addr, name, _ in nearby_devices:
    print(f"Found device: {name} - {addr}")

if name == "main":
discover_devices()

When I run it, I get:
(BLE_39_env) johndraper@Johns-MacBook-Pro MacPython % python3 Blu_discovery.py
Discovering nearby devices:
Traceback (most recent call last):
File "/Volumes/T7/Programming/CrunchComm/MacPython/Blu_discovery.py", line 11, in
discover_devices()
File "/Volumes/T7/Programming/CrunchComm/MacPython/Blu_discovery.py", line 5, in discover_devices
nearby_devices = bluetooth.discover_devices(duration=8, lookup_names=True, lookup_class=True, flush_cache=True)
File "/Volumes/T7/Programming/CrunchComm/MacPython/BLE_39_env/lib/python3.9/site-packages/bluetooth/macos.py", line 12, in discover_devices
devices = lightblue.finddevices(getnames=lookup_names, length=duration)
AttributeError: module 'lightblue' has no attribute 'finddevices'
(BLE_39_env) johndraper@Johns-MacBook-Pro MacPython %

What am I doing wrong? Please help!!! I really need this....

@jdcrunchman
Copy link

Is there a workaround?

@jdcrunchman
Copy link

Yea, if there is a published workaround, where would I find it. It's been about 5 days now, I tried solving it, but its way past my pay scale. Is anyone else still working on this problem?

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

6 participants