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 相关文章推荐
使用70行Python代码实现一个递归下降解析器的教程
Apr 17 Python
python+requests+unittest API接口测试实例(详解)
Jun 10 Python
python内置函数:lambda、map、filter简单介绍
Nov 16 Python
Python Flask-web表单使用详解
Nov 18 Python
python定时复制远程文件夹中所有文件
Apr 30 Python
Python实现二叉搜索树BST的方法示例
Jul 30 Python
浅析Python数字类型和字符串类型的内置方法
Dec 22 Python
使用pytorch 筛选出一定范围的值
Jun 28 Python
python自动从arxiv下载paper的示例代码
Dec 05 Python
Python基础之常用库常用方法整理
Apr 30 Python
Python实现信息轰炸工具(再也不怕说不过别人了)
Jun 11 Python
python turtle绘图命令及案例
Nov 23 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 数组的创建、调用和更新实现代码
2009/03/09 PHP
PHP数据过滤的方法
2013/10/30 PHP
destoon后台网站设置变成空白的解决方法
2014/06/21 PHP
php使用cookie显示用户上次访问网站日期的方法
2015/01/26 PHP
PHP安全上传图片的方法
2015/03/21 PHP
PHP count()函数讲解
2019/02/03 PHP
Prototype Array对象 学习
2009/07/19 Javascript
jQuery 表单验证扩展(四)
2010/10/20 Javascript
js编写trim()函数及正则表达式的运用
2013/10/24 Javascript
alert出数组中的随即值代码
2014/09/25 Javascript
JavaScript 学习笔记之基础中的基础
2015/01/13 Javascript
js和jquery分别验证单选框、复选框、下拉框
2015/12/17 Javascript
AngularJS表格样式简单设置方法示例
2017/03/03 Javascript
详谈js原型继承的一些问题
2017/09/06 Javascript
微信小程序实现预览图片功能
2020/10/22 Javascript
一步步教你利用Docker设置Node.js
2018/11/20 Javascript
vue 返回上一页,页面样式错乱的解决
2019/11/14 Javascript
js实现图片上传到服务器和回显
2020/01/19 Javascript
vue中defineProperty和Proxy的区别详解
2020/11/30 Vue.js
[57:59]完美世界DOTA2联赛循环赛 Ink Ice vs LBZS BO2第一场 11.05
2020/11/05 DOTA
用Python的Django框架编写从Google Adsense中获得报表的应用
2015/04/17 Python
由浅入深讲解python中的yield与generator
2017/04/05 Python
Python OpenCV获取视频的方法
2018/02/28 Python
python中多个装饰器的调用顺序详解
2019/07/16 Python
python实现网站用户名密码自动登录功能
2019/08/09 Python
Python英文文章词频统计(14份剑桥真题词频统计)
2019/10/13 Python
keras绘制acc和loss曲线图实例
2020/06/15 Python
python怎么对数字进行过滤
2020/07/05 Python
Python全局变量与global关键字常见错误解决方案
2020/10/05 Python
使用Python解析Chrome浏览器书签的示例
2020/11/13 Python
Betsey Johnson官网:妖娆可爱的连衣裙及鞋子、手袋和配件
2016/12/30 全球购物
奥巴马获胜演讲稿
2014/05/15 职场文书
药品营销策划方案
2014/06/15 职场文书
服装区域经理岗位职责
2015/04/10 职场文书
2015年防灾减灾工作总结
2015/07/24 职场文书
MySQL数据库必备之条件查询语句
2021/10/15 MySQL