Установка pybluez через ошибки в pip - PullRequest
1 голос
/ 10 апреля 2020

Итак, я пытался установить пакет Bluetooth для python через pip. Я вижу, что при загрузке и установке gattlib упаковывает ошибки установки. Размещение журнала ниже. Приветствуется любая помощь.

Версия для пипсов: pip 20.0.2 из /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.

Заранее спасибо.

1 Ответ

0 голосов
/ 15 апреля 2020

У меня был установлен libboost-dev. Он выдавал ошибку из-за

/usr/bin/ld: cannot find -lboost_python35

Так что в моем / usr / lib / x86_64- linux -gnu общий объект имел имя libboost_ python -py35.so. Поэтому я создал символическую c ссылку на libboost_python35.so

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

Наконец-то это сработало !! Спасибо всем ..

...