ubuntu18.04 pybluez pip3安装

在Ubuntu上尝试使用pip3安装PyBluez包时遇到错误,问题在于编译过程中缺少蓝牙头文件bluetooth/bluetooth.h。解决方法是通过sudo apt-get install libbluetooth-dev安装必要的开发库,然后重新运行pip3 install PyBluez安装包,成功解决问题。

最近想在ubuntu上使用一下蓝牙适配器写个小程序用用,

在使用命令安装pybluez包的时候

pip3 install PyBluez

报以下错误

➜  ~ pip3 install PyBluez
Collecting PyBluez
  Using cached PyBluez-0.23.tar.gz (97 kB)
Building wheels for collected packages: PyBluez
  Building wheel for PyBluez (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/jason/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4hs6_v2b/pybluez_5d9642d3470e4a34b6d96d329e16c26f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4hs6_v2b/pybluez_5d9642d3470e4a34b6d96d329e16c26f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ukauncjg
       cwd: /tmp/pip-install-4hs6_v2b/pybluez_5d9642d3470e4a34b6d96d329e16c26f/
  Complete output (34 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/bluetooth
  copying bluetooth/__init__.py -> build/lib.linux-x86_64-3.7/bluetooth
  copying bluetooth/macos.py -> build/lib.linux-x86_64-3.7/bluetooth
  copying bluetooth/btcommon.py -> build/lib.linux-x86_64-3.7/bluetooth
  copying bluetooth/bluez.py -> build/lib.linux-x86_64-3.7/bluetooth
  copying bluetooth/widcomm.py -> build/lib.linux-x86_64-3.7/bluetooth
  copy
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值