PyBluez没有检测到内置的蓝牙适配器

时间:2010-11-16 19:36:39

标签: python bluetooth

我想开始开发一些工具,让我通过蓝牙在我的手机和电脑之间进行通信,我想用它来使用Python。我安装了python蓝牙模块(PyBluez),但它没有检测到我内置的BT适配器(我在东芝Satellite A300上)。

import bluetooth
nearby_devices = bluetooth.discover_devices()

print(nearby_devices)

返回以下错误:

Traceback (most recent call last):
  File "C:/Python26/bt.py", line 3, in <module>
    nearby_devices = bluetooth.discover_devices()
  File "C:\Python26\lib\site-packages\bluetooth\msbt.py", line 9, in discover_devices
    return bt.discover_devices (flush_cache, lookup_names)
IOError: No Bluetooth adapter detected

任何帮助?

2 个答案:

答案 0 :(得分:2)

PyBluez使用MS蓝牙驱动程序堆栈和Widcom for Windows,对于Linux,它使用BlueZ。如果你的笔记本电脑有不同的堆栈,通常不能正常工作。

答案 1 :(得分:1)

您可以卸载驱动程序(如果可能),然后重新启动Windows并让它安装默认驱动程序。 如果你管理它,PyBluez会更好。