PyBluez上的OSError 0.22

时间:2018-04-18 21:05:49

标签: python python-3.x bluetooth pybluez

在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,这应该是一个简单的测试程序......

1 个答案:

答案 0 :(得分:0)

这是因为PyBluez仅适用于GNU / Linux和Windows XP并且有保证。而你正试图在Win10上使用PyBluez。

您可以尝试将USB蓝牙设备插入USB 3.0端口,如issue中所述。