Skip to content

Installation on Raspberry Pi 3

Eric Platon edited this page Jan 22, 2019 · 3 revisions

The following commands should install pybluez (and pybluezble) on a Raspberry Pi 3. I figured this out after a lot of trial-and-error and thought I'd share it here.

sudo apt-get install libbluetooth-dev python-dev libglib2.0-dev libboost-python-dev libboost-thread-dev

pip3 download gattlib
tar xvzf ./gattlib-0.20150805.tar.gz
cd gattlib-0.20150805/
sed -ie 's/boost_python-py34/boost_python-py35/' setup.py
pip3 install .

sudo python3 -m pip install pybluez pybluez\[ble\]

The sed -ie 's/boost_python-py34/boost_python-py35/' setup.py line replaces boost_python 3.4 with boost_python 3.5.

You may want to look in /usr/lib/arm-linux-gnueabihf/ (simply do a ls /usr/lib/arm-linux-gnueabihf/) to check if 3.5 is the correct version for you. You may then have to change the line to read sed -ie 's/boost_python-py34/boost_python-py36/' setup.py for boost_python 3.6 or any other version.

See also an alternative install script tested on Raspberry Pi 3 Model B v1.2, with Python 3.4. This version hopefully works on later versions too (untested).

Clone this wiki locally