
安装pybluez
安装libbluetooth-dev避免报错
sudo apt-get install libbluetooth-dev
安装pybluez
sudo apt-get install pybluez
例子:pybluz 查询蓝牙
1 |
import bluetooth |
1、import bluetooth
报错:no module named bluetooth
原因及解决方法:
You’ve installed the Python 2 version of the bluez bindings. Either run the script using
python2 or install the Python 3 bindings. Since they aren’t packaged, you would need to install them using pip:
python3 -m pip install pybluez
2、no module named gattlib
解决方法:sudo apt-get install libboost-python-dev libboost-thread-dev libbluetooth-dev libglib2.0-dev




近期评论