在Windows 10和Python 3.6上运行PyBluez,每次调用bluetooth.discover_devices()函数时都会出现OSError。
截至目前,代码仅包含3行:
import bluetooth
print "Searching for devices... \n"
nearby_devices = bluetooth.discover_devices()
控制台然后给出:
Searching for devices...
Traceback (most recent call last):
File "D:\Documentos\UFSC\9ª Fase\Projeto Integrador\testeBT.py", line 9, in <module>
nearby_devices = bluetooth.discover_devices()
File "C:\Users\Thaler\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bluetooth\msbt.py", line 15, in discover_devices
devices = bt.discover_devices(duration=duration, flush_cache=flush_cache)
OSError
任何解决方案?我之前从未使用过PyBluez,这应该是一个简单的测试程序......