且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PyBluez'模块对象没有属性' discover_devices'

更新时间:2022-05-14 22:10:14

我也遇到了同样的问题,我在命名程序文件 bluetooth.py 时犯了一个错误,该错误使python的软件包解析混乱,如果是这种情况,您应该注意这个愚蠢的错误.

I had the same problem, I did the mistake of naming my program file bluetooth.py , which confused python for the package resolution, you should look out for this silly mistake if this is the case .

如果不是这种情况,请尝试将文件放在蓝牙目录(在我的情况下为 C:\ Python27 \ Lib \ site-packages )所在的目录中,然后运行从那里开始,它对我有用.

If this is not the case then try to put your file in the directory where your bluetooth directory (in my case, C:\Python27\Lib\site-packages) is located and then run it from there, it worked for me.