简体   繁体   English

通过 pip 安装 pybluez 出错

[英]Installing pybluez through pip errors out

So I was trying to install a Bluetooth package for python through pip.所以我试图通过 pip 为 python 安装蓝牙 package。 I see that while downloading and installing, the gattlib package the installation errors out.我看到在下载和安装时,gattlib package 安装错误。 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) Pip 版本: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.

Thanks in advance.提前致谢。

I had the libboost-dev installed.我安装了 libboost-dev。 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.因此,在我的 /usr/lib/x86_64-linux-gnu 下,共享的 object 以 libboost_python-py35.so 的名称命名。 Hence, I created a symbolic link to libboost_python35.so因此,我创建了一个指向 libboost_python35.so 的符号链接

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

It finally worked.. Thank you all..终于成功了。。谢谢大家。。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM