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

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

pip3 install PyBluez

报以下错误

➜  ~ pip3 install PyBluez
Collecting PyBluezUsing cached PyBluez-0.23.tar.gz (97 kB)
Building wheels for collected packages: PyBluezBuilding wheel for PyBluez (setup.py) ... errorERROR: 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-ukauncjgcwd: /tmp/pip-install-4hs6_v2b/pybluez_5d9642d3470e4a34b6d96d329e16c26f/Complete output (34 lines):running bdist_wheelrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.7creating build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/__init__.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/macos.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/btcommon.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/bluez.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/widcomm.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/msbt.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/ble.py -> build/lib.linux-x86_64-3.7/bluetoothFixing build/lib.linux-x86_64-3.7/bluetooth/__init__.py build/lib.linux-x86_64-3.7/bluetooth/macos.py build/lib.linux-x86_64-3.7/bluetooth/btcommon.py build/lib.linux-x86_64-3.7/bluetooth/bluez.py build/lib.linux-x86_64-3.7/bluetooth/widcomm.py build/lib.linux-x86_64-3.7/bluetooth/msbt.py build/lib.linux-x86_64-3.7/bluetooth/ble.pySkipping optional fixer: bufferSkipping optional fixer: idiomsSkipping optional fixer: set_literalSkipping optional fixer: ws_commaFixing build/lib.linux-x86_64-3.7/bluetooth/__init__.py build/lib.linux-x86_64-3.7/bluetooth/macos.py build/lib.linux-x86_64-3.7/bluetooth/btcommon.py build/lib.linux-x86_64-3.7/bluetooth/bluez.py build/lib.linux-x86_64-3.7/bluetooth/widcomm.py build/lib.linux-x86_64-3.7/bluetooth/msbt.py build/lib.linux-x86_64-3.7/bluetooth/ble.pySkipping optional fixer: bufferSkipping optional fixer: idiomsSkipping optional fixer: set_literalSkipping optional fixer: ws_commarunning build_extbuilding 'bluetooth._bluetooth' extensioncreating build/temp.linux-x86_64-3.7creating build/temp.linux-x86_64-3.7/bluezgcc -pthread -B /home/jason/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./port3 -I/home/jason/anaconda3/include/python3.7m -c bluez/btmodule.c -o build/temp.linux-x86_64-3.7/bluez/btmodule.oIn file included from bluez/btmodule.c:20:0:bluez/btmodule.h:5:10: fatal error: bluetooth/bluetooth.h: No such file or directory#include <bluetooth/bluetooth.h>^~~~~~~~~~~~~~~~~~~~~~~compilation terminated.error: command 'gcc' failed with exit status 1----------------------------------------ERROR: Failed building wheel for PyBluezRunning setup.py clean for PyBluez
Failed to build PyBluez
Installing collected packages: PyBluezRunning setup.py install for PyBluez ... errorERROR: 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'"'"'))' install --record /tmp/pip-record-ss04_pqx/install-record.txt --single-version-externally-managed --compile --install-headers /home/jason/anaconda3/include/python3.7m/PyBluezcwd: /tmp/pip-install-4hs6_v2b/pybluez_5d9642d3470e4a34b6d96d329e16c26f/Complete output (34 lines):running installrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.7creating build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/__init__.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/macos.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/btcommon.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/bluez.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/widcomm.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/msbt.py -> build/lib.linux-x86_64-3.7/bluetoothcopying bluetooth/ble.py -> build/lib.linux-x86_64-3.7/bluetoothFixing build/lib.linux-x86_64-3.7/bluetooth/__init__.py build/lib.linux-x86_64-3.7/bluetooth/macos.py build/lib.linux-x86_64-3.7/bluetooth/btcommon.py build/lib.linux-x86_64-3.7/bluetooth/bluez.py build/lib.linux-x86_64-3.7/bluetooth/widcomm.py build/lib.linux-x86_64-3.7/bluetooth/msbt.py build/lib.linux-x86_64-3.7/bluetooth/ble.pySkipping optional fixer: bufferSkipping optional fixer: idiomsSkipping optional fixer: set_literalSkipping optional fixer: ws_commaFixing build/lib.linux-x86_64-3.7/bluetooth/__init__.py build/lib.linux-x86_64-3.7/bluetooth/macos.py build/lib.linux-x86_64-3.7/bluetooth/btcommon.py build/lib.linux-x86_64-3.7/bluetooth/bluez.py build/lib.linux-x86_64-3.7/bluetooth/widcomm.py build/lib.linux-x86_64-3.7/bluetooth/msbt.py build/lib.linux-x86_64-3.7/bluetooth/ble.pySkipping optional fixer: bufferSkipping optional fixer: idiomsSkipping optional fixer: set_literalSkipping optional fixer: ws_commarunning build_extbuilding 'bluetooth._bluetooth' extensioncreating build/temp.linux-x86_64-3.7creating build/temp.linux-x86_64-3.7/bluezgcc -pthread -B /home/jason/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./port3 -I/home/jason/anaconda3/include/python3.7m -c bluez/btmodule.c -o build/temp.linux-x86_64-3.7/bluez/btmodule.oIn file included from bluez/btmodule.c:20:0:bluez/btmodule.h:5:10: fatal error: bluetooth/bluetooth.h: No such file or directory#include <bluetooth/bluetooth.h>^~~~~~~~~~~~~~~~~~~~~~~compilation terminated.error: command 'gcc' failed with exit status 1----------------------------------------
ERROR: Command errored out with exit status 1: /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'"'"'))' install --record /tmp/pip-record-ss04_pqx/install-record.txt --single-version-externally-managed --compile --install-headers /home/jason/anaconda3/include/python3.7m/PyBluez Check the logs for full command output.

大致意思就是,在编译蓝牙的这个包的时候缺少头文件

fatal error: bluetooth/bluetooth.h: No such file or directory

于是安装

sudo apt-get install libbluetooth-dev

然后重新安装pybluez的包就OK了。问题解决。

ubuntu18.04 pybluez pip3安装相关推荐

  1. ubuntu18.04在终端安装pip3时404 Not Found [IP: 91.189.91.24 80]_木绿的博客-CSDN博客

    ubuntu18.04在终端安装pip3时404 Not Found [IP: 91.189.91.24 80]_木绿的博客-CSDN博客 解决办法如下 亲测可用 sudo apt-get updat ...

  2. Ubuntu18.04环境下安装ERPNext 12

    前言 之前提到准备安装ERPNext进行测试,看看是否符合公司的业务形式和需求.在先后尝试了CentOS 8,Ubuntu20.04后,均未成功,因此将目标定在了CentOS 7上.结果,尝试一番又以 ...

  3. ubuntu18.04.4 pip3 换清华、阿里、豆瓣 源

    文章目录 ubuntu18.04.4 pip3 换源 官方源 清华源 阿里源 豆瓣源 中国科学技术大学源 华中科技大学源 永久换源 1 创建 .pip文件 2 进入文件 3 创建pip.conf文件 ...

  4. ubuntu18.04.4 pip3 换源

    ubuntu18.04.4 pip3 换源 pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple 包名

  5. Ubuntu18.04.3虚拟机安装步骤图文教程

    虚拟机的安装步骤就不教学了! 自行百度! 接下来 教学ubuntu18.04.3desktop_amd64版本的安装和配置教程 软件下载地址详细介绍:ubuntu 18.04.3 下载速度很快:25M ...

  6. ubuntu18.04 Qt Creator 安装+ROS Qt Creator Plug-in 插件安装笔记

    ubuntu18.04 Qt Creator 安装+ROS Qt Creator Plug-in 插件安装笔记: 一.Qt Creator 5.10安装 官网下载地址: http://download ...

  7. ubuntu18.04+nvidia显卡安装+cuda9.0+cudnn7+pycharm2018.2专业版激活+anaconda3+tensorflow-gpu1.6.0+keras+opencv3

    写文的目的:笔记本和台式机的安装是略有不同的,为了以后查阅方便,记录下安装细节 目标:在台式机上安装上ubuntu18.04+nvidia显卡安装+cuda9.0+cudnn7+anaconda3+t ...

  8. Ubuntu18.04+Halcon18.11安装教程

    Ubuntu18.04+Halcon18.11安装教程 HALCON下载 建议到HALCON官方下载页选择linux版本下载,压缩包名为MVTec_HALCON_Progress-18.11.0.1- ...

  9. ubuntu18.04下hadoop安装与集群配置

    ubuntu18.04下hadoop安装与集群配置 hadoop安装_单机/伪分布式配置 环境 创建hadoop用户 更新apt 安装SSH.配置SSH无密码登陆 安装Java环境 安装 Hadoop ...

  10. 腾讯云Ubuntu18.04.4上安装brat文本标注工具(2020年9月)

    参考博文: https://zhuanlan.zhihu.com/p/65101293 https://zhuanlan.zhihu.com/p/92334491 https://www.cnblog ...

最新文章

  1. 【指导]如何编译完整建立开发环境和编译Android 4.0.1 on Ubuntu 11.04 (64 bit)
  2. weex Android 空白,Weex H5显示正常,android和ios皆显示一片空白,为什么呢?
  3. 编写 matlab怎么调用 8 点和 16 点的 fft,8点基于DIT的FFT的实现
  4. SAP 报表程序的一些标准功能码
  5. Centos7 vim/vi的使用
  6. 宁波政务云资源的介绍与申请
  7. C++笔记-VS2015加载Live2D(OpenGL)
  8. 代码片段:计算倒计时
  9. spring boot test [ 2.0.6.RELEASE version ]
  10. 转载:SPFA算法学习
  11. 南丁格尔玫瑰图 python_央视都在用的“南丁格尔玫瑰图”,原来Python也可以画...
  12. 电脑可以联网但是有的网页打不开
  13. python列表输出序号_Python中打印列表的序号和内容
  14. 【优先队列】Toda 2
  15. Java支付宝APP支付-验证异步通知消息
  16. CSS的3D应用:绘制长方体
  17. hive修复多级分区
  18. java毕业设计——基于java+Servlet+jsp的网上花店销售系统设计与实现(毕业论文+程序源码)——网上花店销售系统
  19. Process on绘制er图、扩大界面
  20. 2021年新规下申请测绘资质甲级、乙级需要满足的条件有哪些?

热门文章

  1. yolov3批量测试并存在自己定义的路径(linux,Joseph Redmon,c版本)
  2. 服务器安卓系统安装教程,安卓系统安装到云服务器
  3. 一:log4j2配置文档
  4. worldPress数据库
  5. echarts水球图-动态波纹百分比数据显示
  6. Python网页应用开发神器fac框架正式发布
  7. 09高考零分作文精选
  8. 十进制小数化为二进制小数的方法是什么_二进制的转换
  9. 将自己的app加入到分享列表中,并适配锤子的one step功能
  10. python matplotlib实现动态实时温度曲线