发现蓝牙设备IOError:RPC服务器不可用

问题描述:

我刚刚尝试使用PyCharm中的Python实现蓝牙,使用PyBluez。我被这个特定的错误卡住了。我试图搜索这个错误,但找不到它。任何人都可以帮忙吗?发现蓝牙设备IOError:RPC服务器不可用

这是我的代码

>>> from bluetooth import discover_devices 
>>> nearby_devices = discover_devices() 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "C:\Python27\lib\site-packages\bluetooth\msbt.py", line 15, in discover_devices 
    devices = bt.discover_devices(duration=duration, flush_cache=flush_cache) 
IOError: The RPC server is unavailable. 
+0

我得到了同样的错误。我检查了服务,蓝牙支持服务没有运行(我想我很久以前就禁用了它)。我重新启动它,并得到了一个不同的错误'IOError:句柄无效.'。我附近没有蓝牙设备,所以我无法测试。你的电脑能够发现设备吗? –

我有同样的错误,并设法解决它。

我的笔记本电脑禁用了蓝牙无线电设备。

我打开了设备管理器,选择了设备并启用了它。现在

我的输出是:

>>> from bluetooth import discover_devices 
>>> discover_devices() 
['2C:4A:05:96:27:01']