got error while download gattlib via pip3

不问归期 提交于 2020-03-17 10:38:19

问题


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


回答1:


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 .



回答2:


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 .



回答3:


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 .



回答4:


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.




回答5:


This works with Raspberry 2, Rasbian Buster and Python 3. Note that Python 3 libraries seems to have different naming “The bug can be solved easily by replacing boost_python_py34 with boost_python3 when specifying the boost libraries in setup.py.“

sed -ie 's/boost_python-py37/boost_python3/' setup.py

Libraries:

/usr/lib/arm-linux-gnueabihf/libboost_python3.a
/usr/lib/arm-linux-gnueabihf/libboost_python3-py37.a
/usr/lib/arm-linux-gnueabihf/libboost_python3-py37.so
/usr/lib/arm-linux-gnueabihf/libboost_python3.so


来源:https://stackoverflow.com/questions/41463847/got-error-while-download-gattlib-via-pip3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!