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 相关文章推荐
Django中的CACHE_BACKEND参数和站点级Cache设置
Jul 23 Python
Python基础语法(Python基础知识点)
Feb 28 Python
常见的python正则用法实例讲解
Jun 21 Python
python实现下载文件的三种方法
Feb 09 Python
python学习--使用QQ邮箱发送邮件代码实例
Apr 16 Python
Python实现微信翻译机器人的方法
Aug 13 Python
python numpy存取文件的方式
Apr 01 Python
python 非线性规划方式(scipy.optimize.minimize)
Feb 11 Python
使用Pyhton 分析酒店针孔摄像头
Mar 04 Python
Pandas中DataFrame基本函数整理(小结)
Jul 20 Python
一篇文章带你搞定Ubuntu中打开Pycharm总是卡顿崩溃
Nov 02 Python
Python测试框架pytest高阶用法全面详解
Jun 01 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 的几个配置文件函数
2006/12/21 PHP
php array_map()数组函数使用说明
2011/07/12 PHP
php循环语句 for()与foreach()用法区别介绍
2012/09/05 PHP
详解WordPress开发中get_header()获取头部函数的用法
2016/01/08 PHP
PHP判断密码强度的方法详解
2017/05/26 PHP
PHP的PDO错误与错误处理
2019/01/27 PHP
PHP中引用类型和值类型功能与用法示例
2019/02/26 PHP
jquery ui resizable bug解决方法
2010/10/26 Javascript
jquery.cvtooltip.js 基于jquery的气泡提示插件
2010/11/19 Javascript
javascript使用isNaN()函数判断变量是否为数字
2013/09/21 Javascript
jquery中JSON的解析方式
2015/03/16 Javascript
javascript实现简单的贪吃蛇游戏
2015/03/31 Javascript
js实现字符串和数组之间相互转换操作
2016/01/12 Javascript
基于javascript实现句子翻牌网页版小游戏
2016/03/23 Javascript
jQuery可见性过滤选择器用法示例
2016/09/09 Javascript
AngularJS中$apply方法和$watch方法用法总结
2016/12/13 Javascript
基于Vue的文字跑马灯组件(npm 组件包)
2017/05/24 Javascript
浅谈vuepress 踩坑记
2018/04/18 Javascript
vue实现微信分享功能
2018/11/28 Javascript
vue实现pdf文档在线预览功能
2019/11/26 Javascript
js实现验证码干扰(动态)
2021/02/23 Javascript
深入解析Python中函数的参数与作用域
2016/03/20 Python
python3音乐播放器简单实现代码
2020/04/20 Python
详解python中的线程
2018/02/10 Python
Django自定义过滤器定义与用法示例
2018/03/22 Python
PyCharm代码格式调整方法
2018/05/23 Python
华为校园招聘上机笔试题 扑克牌大小(python)
2020/04/22 Python
浅析PEP572: 海象运算符
2019/10/15 Python
Python爬虫与反爬虫大战
2020/07/30 Python
python matplotlib工具栏源码探析三之添加、删除自定义工具项的案例详解
2021/02/25 Python
美国学校用品、教室和教学商店:Discount School Supply
2018/04/04 全球购物
初中生自我鉴定
2014/02/04 职场文书
师德师风自查总结
2014/10/14 职场文书
Spring Boot 排除某个类加载注入IOC的操作
2021/08/02 Java/Android
Python数组变形的几种实现方法
2022/05/30 Python
微软发布Windows 11今年最大更新22H2(附 ISO 镜像官方下载)
2022/09/23 数码科技