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连接MySQL并使用fetchall()方法过滤特殊字符
Mar 13 Python
深入理解python中的浅拷贝和深拷贝
May 30 Python
浅谈python的dataframe与series的创建方法
Nov 12 Python
对matplotlib改变colorbar位置和方向的方法详解
Dec 13 Python
python实现网页自动签到功能
Jan 21 Python
Python 使用元类type创建类对象常见应用详解
Oct 17 Python
python对象转字典的两种实现方式示例
Nov 07 Python
细数nn.BCELoss与nn.CrossEntropyLoss的区别
Feb 29 Python
Python3创建Django项目的几种方法(3种)
Jun 03 Python
Python通过fnmatch模块实现文件名匹配
Sep 30 Python
几款好用的python工具库(小结)
Oct 20 Python
Pytorch使用shuffle打乱数据的操作
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
回首过去10年中最搞笑的10部动漫,哪一部让你节操尽碎?
2020/03/03 日漫
php中通过curl检测页面是否被百度收录
2013/09/27 PHP
PHP中使用asort进行中文排序失效的问题处理
2014/08/18 PHP
php实现上传图片保存到数据库的方法
2015/02/11 PHP
php中的依赖注入实例详解
2019/08/14 PHP
javascript中onmouse事件在div中失效问题的解决方法
2012/01/09 Javascript
JavaScript获取路径设计源码
2014/05/22 Javascript
javascript比较两个日期相差天数的方法
2015/07/24 Javascript
jquery判断input值不为空的方法
2016/06/05 Javascript
jquery插件格式实例分析
2016/06/16 Javascript
利用jQuery插件imgAreaSelect实现图片上传裁剪(放大缩小)
2016/12/02 Javascript
微信开发 JS-SDK 6.0.2 经常遇到问题总结
2016/12/08 Javascript
js学习心得_一个简单的动画库封装tween.js
2017/07/14 Javascript
echarts学习笔记之图表自适应问题详解
2017/11/22 Javascript
解决IOS端微信H5页面软键盘弹起后页面下方留白的问题
2019/06/05 Javascript
jQuery 函数实例分析【函数声明、函数表达式、匿名函数等】
2020/05/19 jQuery
微信小程序canvas动态时钟
2020/10/22 Javascript
[06:45]2018DOTA2亚洲邀请赛 4.5 SOLO赛 Sccc vs Maybe
2018/04/06 DOTA
python人人网登录应用实例
2014/09/26 Python
基于Python实现的微信好友数据分析
2018/02/26 Python
分享vim python缩进等一些配置
2018/07/02 Python
python中的常量和变量代码详解
2018/07/25 Python
Python Pandas数据结构简单介绍
2019/07/03 Python
Python 格式化打印json数据方法(展开状态)
2020/02/27 Python
通过cmd进入python的步骤
2020/06/16 Python
Django+Uwsgi+Nginx如何实现生产环境部署
2020/07/31 Python
Myprotein葡萄牙官方网站:英国优质运动营养品牌
2016/09/12 全球购物
中国高端鲜花第一品牌:roseonly(一生只送一人)
2017/02/12 全球购物
值类型与引用类型有什么不同?请举例说明?并分别列举几种相应的数据类型
2015/10/24 面试题
微电影大赛策划方案
2014/06/05 职场文书
班级学雷锋活动总结
2014/06/26 职场文书
2014年光棍节活动策划方案(创意集锦)
2014/09/29 职场文书
2014年实习班主任工作总结
2014/11/08 职场文书
2015年城管执法工作总结
2015/07/23 职场文书
小学班主任教育随笔
2015/08/15 职场文书
家访教师心得体会
2016/01/23 职场文书