I've practically scoured the entire web (metaphorically speaking) trying to find a way to work with Bluetooth via Python on Mac. PyBluez is not compatible, Lightblue is not being maintained (tried regardless), installed the PyObC framework (incl Bluetooth Framework), and attempted in both my 2.7.6 and 3.6.1 environments with MacOS 10.10.5.
I often get errors similar to the below:
Traceback (most recent call last):
File "/Users/***/PycharmProjects/Bluey/main.py", line 1, in <module>
import bluetooth
File "build/bdist.macosx-10.10-intel/egg/bluetooth/__init__.py", line 47, in <module>
File "build/bdist.macosx-10.10-intel/egg/bluetooth/osx.py", line 1, in <module>
File "build/bdist.macosx-10.10-intel/egg/lightblue/__init__.py", line 160, in <module>
File "build/bdist.macosx-10.10-intel/egg/lightblue/_lightblue.py", line 31, in <module>
File "build/bdist.macosx-10.10-intel/egg/lightblue/_macutil.py", line 169, in <module>
objc.BadPrototypeError: Objective-C expects 1 arguments, Python argument has 2 arguments for <unbound selector sleep of BBCocoaSleeper at 0x103cdc030>
Process finished with exit code 1
I've also tried reinstalling all the aforementioned modules for both environments.
I just want to be able to work with Bluetooth w/o changing OSs for one project. I'm sure I've missed something since I doubt no-one codes for Bluetooth on Mac with Python. If there are inherent compatibility issues, is there another module that I have yet to discover?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…