2

So I was trying to install a Bluetooth package for python through pip. I see that while downloading and installing, the gattlib package the installation errors out. Posting the log below. Any sort of help is appreciated.

Pip version: pip 20.0.2 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pybluez[ble] in ./.local/lib/python3.5/site-packages (0.23)
Collecting gattlib==0.20150805; extra == "ble"
  Using cached gattlib-0.20150805.tar.gz (1.7 MB)
Building wheels for collected packages: gattlib
  Building wheel for gattlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ljoncfbn/gattlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ljoncfbn/gattlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-o04kd4tx
       cwd: /tmp/pip-install-ljoncfbn/gattlib/
  Complete output (35 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'gattlib' extension
  creating build
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/src
  creating build/temp.linux-x86_64-3.5/src/bluez
  creating build/temp.linux-x86_64-3.5/src/bluez/lib
  creating build/temp.linux-x86_64-3.5/src/bluez/attrib
  creating build/temp.linux-x86_64-3.5/src/bluez/src
  creating build/temp.linux-x86_64-3.5/src/bluez/src/shared
  creating build/temp.linux-x86_64-3.5/src/bluez/btio
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/gattservices.cpp -o build/temp.linux-x86_64-3.5/src/gattservices.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/beacon.cpp -o build/temp.linux-x86_64-3.5/src/beacon.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bindings.cpp -o build/temp.linux-x86_64-3.5/src/bindings.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/gattlib.cpp -o build/temp.linux-x86_64-3.5/src/gattlib.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/lib/uuid.c -o build/temp.linux-x86_64-3.5/src/bluez/lib/uuid.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/attrib/gatt.c -o build/temp.linux-x86_64-3.5/src/bluez/attrib/gatt.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/attrib/gattrib.c -o build/temp.linux-x86_64-3.5/src/bluez/attrib/gattrib.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/attrib/utils.c -o build/temp.linux-x86_64-3.5/src/bluez/attrib/utils.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/attrib/att.c -o build/temp.linux-x86_64-3.5/src/bluez/attrib/att.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/src/shared/crypto.c -o build/temp.linux-x86_64-3.5/src/bluez/src/shared/crypto.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/src/log.c -o build/temp.linux-x86_64-3.5/src/bluez/src/log.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/btio/btio.c -o build/temp.linux-x86_64-3.5/src/bluez/btio/btio.o
  creating build/lib.linux-x86_64-3.5
  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/src/gattservices.o build/temp.linux-x86_64-3.5/src/beacon.o build/temp.linux-x86_64-3.5/src/bindings.o build/temp.linux-x86_64-3.5/src/gattlib.o build/temp.linux-x86_64-3.5/src/bluez/lib/uuid.o build/temp.linux-x86_64-3.5/src/bluez/attrib/gatt.o build/temp.linux-x86_64-3.5/src/bluez/attrib/gattrib.o build/temp.linux-x86_64-3.5/src/bluez/attrib/utils.o build/temp.linux-x86_64-3.5/src/bluez/attrib/att.o build/temp.linux-x86_64-3.5/src/bluez/src/shared/crypto.o build/temp.linux-x86_64-3.5/src/bluez/src/log.o build/temp.linux-x86_64-3.5/src/bluez/btio/btio.o -lglib-2.0 -lboost_python-py34 -lboost_thread -lbluetooth -o build/lib.linux-x86_64-3.5/gattlib.cpython-35m-x86_64-linux-gnu.so
  /usr/bin/ld: cannot find -lboost_python-py34
  /usr/bin/ld: cannot find -lboost_thread
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-g++' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for gattlib
  Running setup.py clean for gattlib
Failed to build gattlib
Installing collected packages: gattlib
    Running setup.py install for gattlib ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ljoncfbn/gattlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ljoncfbn/gattlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-30i9q4xf/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/maneesh_n/.local/include/python3.5m/gattlib
         cwd: /tmp/pip-install-ljoncfbn/gattlib/
    Complete output (35 lines):
    running install
    running build
    running build_ext
    building 'gattlib' extension
    creating build
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/src
    creating build/temp.linux-x86_64-3.5/src/bluez
    creating build/temp.linux-x86_64-3.5/src/bluez/lib
    creating build/temp.linux-x86_64-3.5/src/bluez/attrib
    creating build/temp.linux-x86_64-3.5/src/bluez/src
    creating build/temp.linux-x86_64-3.5/src/bluez/src/shared
    creating build/temp.linux-x86_64-3.5/src/bluez/btio
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/gattservices.cpp -o build/temp.linux-x86_64-3.5/src/gattservices.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/beacon.cpp -o build/temp.linux-x86_64-3.5/src/beacon.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bindings.cpp -o build/temp.linux-x86_64-3.5/src/bindings.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/gattlib.cpp -o build/temp.linux-x86_64-3.5/src/gattlib.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/lib/uuid.c -o build/temp.linux-x86_64-3.5/src/bluez/lib/uuid.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/attrib/gatt.c -o build/temp.linux-x86_64-3.5/src/bluez/attrib/gatt.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/attrib/gattrib.c -o build/temp.linux-x86_64-3.5/src/bluez/attrib/gattrib.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/attrib/utils.c -o build/temp.linux-x86_64-3.5/src/bluez/attrib/utils.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/attrib/att.c -o build/temp.linux-x86_64-3.5/src/bluez/attrib/att.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/src/shared/crypto.c -o build/temp.linux-x86_64-3.5/src/bluez/src/shared/crypto.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/src/log.c -o build/temp.linux-x86_64-3.5/src/bluez/src/log.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="5.25" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Isrc/bluez -I/usr/include/python3.5m -c src/bluez/btio/btio.c -o build/temp.linux-x86_64-3.5/src/bluez/btio/btio.o
    creating build/lib.linux-x86_64-3.5
    x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/src/gattservices.o build/temp.linux-x86_64-3.5/src/beacon.o build/temp.linux-x86_64-3.5/src/bindings.o build/temp.linux-x86_64-3.5/src/gattlib.o build/temp.linux-x86_64-3.5/src/bluez/lib/uuid.o build/temp.linux-x86_64-3.5/src/bluez/attrib/gatt.o build/temp.linux-x86_64-3.5/src/bluez/attrib/gattrib.o build/temp.linux-x86_64-3.5/src/bluez/attrib/utils.o build/temp.linux-x86_64-3.5/src/bluez/attrib/att.o build/temp.linux-x86_64-3.5/src/bluez/src/shared/crypto.o build/temp.linux-x86_64-3.5/src/bluez/src/log.o build/temp.linux-x86_64-3.5/src/bluez/btio/btio.o -lglib-2.0 -lboost_python-py34 -lboost_thread -lbluetooth -o build/lib.linux-x86_64-3.5/gattlib.cpython-35m-x86_64-linux-gnu.so
    /usr/bin/ld: cannot find -lboost_python-py34
    /usr/bin/ld: cannot find -lboost_thread
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-g++' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ljoncfbn/gattlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ljoncfbn/gattlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-30i9q4xf/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/maneesh_n/.local/include/python3.5m/gattlib Check the logs for full command output.

Thanks in advance.

Maneesh N
  • 43
  • 6
  • Does this answer your question? [got error while download gattlib via pip3](https://stackoverflow.com/questions/41463847/got-error-while-download-gattlib-via-pip3) – Proko Apr 10 '20 at 11:37
  • Unless you want to fix that program yourself, you should rather file a bug report. Otherwise, you'd have to extract a [mcve] and include that in your question. As a new user, please also take the [tour] and read [ask]. – Ulrich Eckhardt Apr 10 '20 at 11:54
  • What disto are you using? You need to install the `libboost_thread` and `libboost_python` packages using your package manager (apt, yum, dnf, zypper) – Mikel Rychliski Apr 10 '20 at 13:26

1 Answers1

0

I had the libboost-dev installed. It was erroring out because of,

/usr/bin/ld: cannot find -lboost_python35

So under my /usr/lib/x86_64-linux-gnu the shared object was in the name of libboost_python-py35.so. Hence, I created a symbolic link to libboost_python35.so

sudo ln -s libboost_python-py35.so libboost_python35.so

It finally worked!! Thank you all..

Maneesh N
  • 43
  • 6