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 getopt 参数处理小示例
Jun 09 Python
python实现颜色rgb和hex相互转换的函数
Mar 19 Python
python实现数独算法实例
Jun 09 Python
python 回调函数和回调方法的实现分析
Mar 23 Python
python 数据清洗之数据合并、转换、过滤、排序
Feb 12 Python
python读文件保存到字典,修改字典并写入新文件的实例
Apr 23 Python
Ubuntu下使用python读取doc和docx文档的内容方法
May 08 Python
Python中安装easy_install的方法
Nov 18 Python
python命令行工具Click快速掌握
Jul 04 Python
python函数定义和调用过程详解
Feb 09 Python
解决pytorch下出现multi-target not supported at的一种可能原因
Feb 06 Python
教你怎么用python爬取爱奇艺热门电影
May 20 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下用cookie统计用户访问网页次数的代码
2010/05/09 PHP
简单PHP上传图片、删除图片实现代码
2010/05/12 PHP
CCPry JS类库 代码
2009/10/30 Javascript
javascript实现面向对象类的功能书写技巧
2010/03/07 Javascript
jQuery渐变发光导航菜单的实例代码
2013/03/27 Javascript
ExtJS下书写动态生成的xml(兼容火狐)
2013/04/02 Javascript
JavaScript输入邮箱自动提示实例代码
2014/01/13 Javascript
Js Jquery创建一个弹出层可加载一个页面
2014/05/08 Javascript
knockoutjs模板实现树形结构列表
2017/07/31 Javascript
js使用xml数据载体实现城市省份二级联动效果
2017/11/08 Javascript
浅谈Vue2.0父子组件间事件派发机制
2018/01/08 Javascript
JavaScript创建对象的常用方式总结
2018/08/10 Javascript
vue实现在一个方法执行完后执行另一个方法的示例
2018/08/25 Javascript
详解webpack 最简打包结果分析
2019/02/20 Javascript
使用p5.js临摹动态图形
2019/10/23 Javascript
跟老齐学Python之有容乃大的list(1)
2014/09/14 Python
跟老齐学Python之字典,你还记得吗?
2014/09/20 Python
用Python编写一个简单的FUSE文件系统的教程
2015/04/02 Python
用Python实现换行符转换的脚本的教程
2015/04/16 Python
Python使用PyCrypto实现AES加密功能示例
2017/05/22 Python
Django结合ajax进行页面实时更新的例子
2019/08/12 Python
Python实现密码薄文件读写操作
2019/12/16 Python
基于nexus3配置Python仓库过程详解
2020/06/15 Python
来自世界上最好大学的在线课程:edX
2018/10/16 全球购物
澳大利亚婴儿喂养品牌:Cherub Baby
2018/11/01 全球购物
教师实习期自我鉴定
2013/10/06 职场文书
国贸类专业毕业生的求职信分享
2013/12/08 职场文书
党员自我评价分享
2013/12/13 职场文书
社区学习十八大感想
2014/01/22 职场文书
小学竞选班干部演讲稿
2014/08/20 职场文书
高中学校对照检查材料
2014/08/31 职场文书
小学生纪念九一八事变演讲稿
2014/09/14 职场文书
党的群众路线教育实践活动领导班子对照检查材料
2014/09/25 职场文书
美丽人生观后感
2015/06/03 职场文书
全民创业工作总结
2015/08/13 职场文书
tensorflow中的数据类型dtype用法说明
2021/05/26 Python