python安装dlib库报错问题及解决方法


Posted in Python onMarch 16, 2020

问题描述

我是debain 系的linux系统没遇到这个问题,在centos系统遇到的

Collecting dlib
  Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz (3.2MB)
    100% |????????????????????????????????| 3.2MB 99.4MB/s
Building wheels for collected packages: dlib
  Running setup.py bdist_wheel for dlib ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ld86u12i/dlib/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/tmp0zu3_xkcpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  package init file 'dlib/__init__.py' not found (or not a regular file)
  running build_ext
  Building extension for Python 3.6.8 (default, Aug  7 2019, 17:28:10)
  Invoking CMake setup: 'cmake /tmp/pip-build-ld86u12i/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-build-ld86u12i/dlib/build/lib.linux-x86_64-3.6 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Release'
  -- The C compiler identification is GNU 4.8.5
  -- The CXX compiler identification is unknown
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
  CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
  -- Found PythonInterp: /usr/bin/python3 (found version "3.6.8")
  -- Found PythonLibs: python3.6m
  -- Performing Test HAS_CPP14_FLAG

主要报错就是

  CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.

解决办法

yum install cmake gcc-c++

另一个问题
另外一个地方可能会报错

fatal error: Python.h: No such file or directory
 #include <Python.h>
                   
compilation terminated.

这种报错很常见了

解决办法:

debain系

sudo apt install python3-dev

rehat系

yum install python3-devel

总结

到此这篇关于python安装dlib库报错问题及解决方法的文章就介绍到这了,更多相关python安装dlib库报错内容请搜索三水点靠木以前的文章或继续浏览下面的相关文章希望大家以后多多支持三水点靠木!

Python 相关文章推荐
Python和php通信乱码问题解决方法
Apr 15 Python
Python实现模拟分割大文件及多线程处理的方法
Oct 10 Python
python网络爬虫学习笔记(1)
Apr 09 Python
redis之django-redis的简单缓存使用
Jun 07 Python
Python在for循环中更改list值的方法【推荐】
Aug 17 Python
Python对接支付宝支付自实现功能
Oct 10 Python
Pytorch 数据加载与数据预处理方式
Dec 31 Python
解决ROC曲线画出来只有一个点的问题
Feb 28 Python
基于python实现简单网页服务器代码实例
Sep 14 Python
python 提取html文本的方法
May 20 Python
pytorch--之halfTensor的使用详解
May 24 Python
Python标准库之typing的用法(类型标注)
Jun 02 Python
使用python图形模块turtle库绘制樱花、玫瑰、圣诞树代码实例
Mar 16 #Python
关于win10在tensorflow的安装及在pycharm中运行步骤详解
Mar 16 #Python
Python3.6 中的pyinstaller安装和使用教程
Mar 16 #Python
python pandas利用fillna方法实现部分自动填充功能
Mar 16 #Python
Python Flask上下文管理机制实例解析
Mar 16 #Python
Python threading.local代码实例及原理解析
Mar 16 #Python
python实现ssh及sftp功能(实例代码)
Mar 16 #Python
You might like
PHP执行zip与rar解压缩方法实现代码
2010/12/05 PHP
以实例全面讲解PHP中多进程编程的相关函数的使用
2015/08/18 PHP
js获取变量
2006/08/24 Javascript
基于jQuery制作迷你背词汇工具
2010/07/27 Javascript
js getBoundingClientRect() 来获取页面元素的位置
2010/11/25 Javascript
IE图片缓存document.execCommand(&quot;BackgroundImageCache&quot;,false,true)
2011/03/01 Javascript
javascript获取所有同类checkbox选项(实例代码)
2013/11/07 Javascript
javascript的parseFloat()方法精度问题探讨
2013/11/26 Javascript
nodejs中操作mysql数据库示例
2014/12/20 NodeJs
Javascript中函数名.length属性用法分析(对比arguments.length)
2016/09/16 Javascript
vuejs在解析时出现闪烁的原因及防止闪烁的方法
2016/09/19 Javascript
基于jQuery实现简单人工智能聊天室
2017/02/10 Javascript
详解webpack解惑:require的五种用法
2017/06/09 Javascript
使用重写url机制实现验证码换一张功能
2017/08/01 Javascript
javascript中神奇的 Date对象小结
2017/10/12 Javascript
vue单个组件实现无限层级多选菜单功能
2018/04/10 Javascript
nodejs 十六进制字符串型数据与btye型数据相互转换
2018/07/30 NodeJs
layui点击导航栏刷新tab页的示例代码
2018/08/14 Javascript
解决JS表单验证只有第一个IF起作用的问题
2018/12/04 Javascript
jquery分页优化操作实例分析
2019/08/23 jQuery
jQuery实现提交表单时不提交隐藏div中input的方法
2019/10/08 jQuery
Vue根据条件添加click事件的方式
2019/11/09 Javascript
Python中查看文件名和文件路径
2017/03/31 Python
itchat和matplotlib的结合使用爬取微信信息的实例
2017/08/25 Python
解决Python3.5+OpenCV3.2读取图像的问题
2018/12/05 Python
Python实现将多个空格换为一个空格.md的方法
2018/12/20 Python
Python 使用Numpy对矩阵进行转置的方法
2019/01/28 Python
numpy.random模块用法总结
2019/05/27 Python
python 列表转为字典的两个小方法(小结)
2019/06/28 Python
Python Django简单实现session登录注销过程详解
2019/08/06 Python
美国婴童服装市场上的领先品牌:Carter’s
2018/02/08 全球购物
阿根廷首家户外用品制造商和经销商:Montagne
2018/02/12 全球购物
一个大学生十年的职业规划
2014/01/17 职场文书
高中物理教学反思
2014/02/08 职场文书
python使用pymysql模块操作MySQL
2021/06/16 Python
Dashboard管理Kubernetes集群与API访问配置
2022/04/01 Servers