在Windows 10和Python 3.6上运行PyBluez,每次调用bluetooth时都会出现操作错误。discover\u devices()函数。
截至目前,代码仅包括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,这应该是一个简单的测试程序。。。