Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

got error while download gattlib via pip3

I use Ubuntu 16.04 64bit OS
when I run

$ sudo pip3 install gattlib

I got this error message

/usr/bin/ld: cannot find -lboost_python-py34
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1

I tried googling how to solve this but nothing works for me
I want to use gatttool at python, so I need to install this
How can I solve this?

PS. I already downloaded libboost-dev

like image 851
seok hyun Ko Avatar asked Jan 04 '17 12:01

seok hyun Ko


4 Answers

I was running in to the following error on RPI-3B:
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ src/gattservices.cpp:6:33: fatal error: bluetooth/bluetooth.h: No such file or directory #include ^ compilation terminated. error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

[1] Running the following command helped me to resolve:

sudo apt-get install libbluetooth-dev

[2] Also deleting the folder 'gattlib-0.20150805' and recreating it using 'tar xvzf ...' again, helped cleaning the previous compilation left over files.

like image 181
Steve Avatar answered Oct 20 '22 19:10

Steve


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 .
like image 21
Benjamin Tamasi Avatar answered Nov 05 '22 04:11

Benjamin Tamasi


And for python 3.7 you should do:

pip3 download gattlib
tar xvzf ./gattlib-0.20150805.tar.gz
cd gattlib-0.20150805/
sed -ie 's/boost_python-py34/boost_python37/' setup.py
pip3 install .
like image 5
Mike666 Avatar answered Nov 05 '22 05:11

Mike666


If Benjamin's solution does not work, try changing 35 to 36. i.e. try the code below.

pip3 download gattlib
tar xvzf ./gattlib-0.20150805.tar.gz
cd gattlib-0.20150805/
sed -ie 's/boost_python-py34/boost_python-py36/' setup.py
pip3 install .
like image 2
James Parker Avatar answered Nov 05 '22 05:11

James Parker