0

I am trying to install and use light-blue for Bluetooth and I am getting errors when I use it. i am on mac osx mojave

I tried reinstalling and everything I could find and it's not working

This is the error

Traceback (most recent call last):
  File "ble_read_state.py", line 22, in <module>
    import bluetooth._bluetooth as bluez
  File "/Users/joranosinga/Downloads/pybluez/build/lib/bluetooth/__init__.py", line 47, in <module>
    from .osx import *
  File "/Users/joranosinga/Downloads/pybluez/build/lib/bluetooth/osx.py", line 1, in <module>
    import lightblue
  File "/usr/local/lib/python3.7/site-packages/lightblue/__init__.py", line 160, in <module>
    from _lightblue import *
ModuleNotFoundError: No module named '_lightblue'

I don't know how I can fix this issue.

  • it seems it needs C/C++ library `lightblue` to run it. – furas Jul 28 '19 at 08:02
  • and how do I install it on mac osx – jojo osinga Jul 28 '19 at 08:05
  • I don't use Mac but I would start in Google "lightblue bluetooth mac" and check links. First link shows [LightBlue: a cross-platform Python Bluetooth API](http://lightblue.sourceforge.net/) and there are information about installation on Mac. But there is also message: "This project is no longer maintained." and last news is from year 2009. Maybe you will have to find different module in Python. – furas Jul 28 '19 at 08:33
  • It is for https://github.com/hexway/apple_bleee is there a way to do it – jojo osinga Jul 28 '19 at 08:40
  • it looks like code for Linux and it only hacks Apple's phone. – furas Jul 28 '19 at 08:45
  • I checked [PyBluez](https://github.com/pybluez/pybluez) and it seems it use `PyObjc`. The same `PyObjc` I saw on `LightBlue` page and in [Utilising bluetooth on Mac with Python](https://stackoverflow.com/questions/44374505/utilising-bluetooth-on-mac-with-python) – furas Jul 28 '19 at 08:49
  • so there is no chance that it will work – jojo osinga Jul 28 '19 at 08:51
  • if you can then try to install `PyObjc`. Maybe it has needed module. – furas Jul 28 '19 at 08:55
  • and use Google "Pyobjc bluetooth Mac Python" to find more information. Maybe other users ask it on Stackoverflow, or there is project on GitHub which use it. – furas Jul 28 '19 at 08:56
  • i am downloading an ubuntu ISO thanks for your help – jojo osinga Jul 28 '19 at 08:59

0 Answers0