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 相关文章推荐
Pyhthon中使用compileall模块编译源文件为pyc文件
Apr 28 Python
python xml解析实例详解
Nov 14 Python
python实现对求解最长回文子串的动态规划算法
Jun 02 Python
Python读取系统文件夹内所有文件并统计数量的方法
Oct 23 Python
Python虚拟环境的原理及使用详解
Jul 02 Python
详细整理python 字符串(str)与列表(list)以及数组(array)之间的转换方法
Aug 30 Python
python递归下载文件夹下所有文件
Aug 31 Python
python统计指定目录内文件的代码行数
Sep 19 Python
python json.dumps中文乱码问题解决
Apr 01 Python
python 画图 图例自由定义方式
Apr 17 Python
pyspark给dataframe增加新的一列的实现示例
Apr 24 Python
BeautifulSoup获取指定class样式的div的实现
Dec 07 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中$美元符号与Zen Coding冲突问题解决方法分享
2014/05/28 PHP
Laravel框架实现抢红包功能示例
2019/10/31 PHP
JavaScript实现复制功能各浏览器支持情况实测
2013/07/18 Javascript
nodejs npm包管理的配置方法及常用命令介绍
2014/06/05 NodeJs
js 动态修改css文件的方法
2014/08/05 Javascript
Javascript限制网页只能在微信内置浏览器中访问
2014/11/09 Javascript
浅析javascript的return语句
2015/12/15 Javascript
jQuery Mobile页面返回不需要重新get
2016/04/26 Javascript
Bootstrap插件全集
2016/07/18 Javascript
js中作用域的实例解析
2017/03/16 Javascript
Angular4实现鼠标悬停3d倾斜效果
2017/10/25 Javascript
深入理解JS的事件绑定、事件流模型
2018/05/13 Javascript
解决angular2 获取到的数据无法实时更新的问题
2018/08/31 Javascript
了解JavaScript表单操作和表单域
2019/05/27 Javascript
微信小程序实现手势滑动效果
2019/08/26 Javascript
JS工厂模式开发实践案例分析
2019/10/17 Javascript
nodejs中使用worker_threads来创建新的线程的方法
2021/01/22 NodeJs
Python读写Redis数据库操作示例
2014/03/18 Python
python中while循环语句用法简单实例
2015/05/07 Python
Python3使用腾讯云文字识别(腾讯OCR)提取图片中的文字内容实例详解
2020/02/18 Python
python实现图片横向和纵向拼接
2020/03/05 Python
利用python+request通过接口实现人员通行记录上传功能
2021/01/13 Python
css3编写浏览器背景渐变背景色的方法
2018/03/05 HTML / CSS
Dr. Martens马汀博士澳大利亚官网:马丁靴鼻祖
2019/07/02 全球购物
逻辑链路控制协议
2016/10/01 面试题
优秀生推荐信范文
2013/11/28 职场文书
餐饮主管岗位职责
2013/12/10 职场文书
土建资料员岗位职责
2014/01/04 职场文书
文明宿舍获奖感言
2014/02/07 职场文书
房地产促销活动方案
2014/03/01 职场文书
运输服务质量承诺书
2014/03/27 职场文书
给客户的检讨书
2014/12/21 职场文书
律政俏佳人观后感
2015/06/09 职场文书
MongoDB数据库的安装步骤
2021/06/18 MongoDB
浅谈TypeScript 索引签名的理解
2021/10/16 Javascript
Mysql分库分表之后主键处理的几种方法
2022/02/15 MySQL