1

所以我试图通过pip为python安装一个蓝牙包。我看到在下载和安装时,gattlib 将安装错误打包出来。在下面发布日志。任何形式的帮助表示赞赏。

pip 版本:来自 /usr/local/lib/python3.5/dist-packages/pip (python 3.5) 的 pip 20.0.2

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.

提前致谢。

4

1 回答 1

0

我安装了 libboost-dev。它出错了,因为,

/usr/bin/ld: cannot find -lboost_python35

因此,在我的 /usr/lib/x86_64-linux-gnu 下,共享对象名为 libboost_python-py35.so。因此,我创建了一个指向 libboost_python35.so 的符号链接

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

它终于奏效了!!谢谢你们..

于 2020-04-15T18:48:04.493 回答