python安装dlib库报错问题及解决方法

作者:Hello_wshuo 时间:2023-01-27 16:24:41 

问题描述

我是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

来源:https://blog.csdn.net/chouzhou9701/article/details/104566650

标签:python,dlib库,报错
0
投稿

猜你喜欢

  • Python K最近邻从原理到实现的方法

    2022-10-13 09:41:45
  • layer页面跳转,获取html子节点元素的值方法

    2024-04-29 13:43:15
  • 基于python+selenium的二次封装的实现

    2023-02-19 04:47:16
  • mysql建表常用sql语句个人经验分享

    2024-01-27 12:30:48
  • 重新编译PLSQL中的无效对象或者指定的对象 的方法

    2009-02-26 10:41:00
  • Python动态加载模块的3种方法

    2023-12-22 21:33:29
  • python线程优先级队列知识点总结

    2022-01-04 21:25:46
  • 详解mysql数据库增删改操作

    2024-01-15 02:23:05
  • Python importlib模块重载使用方法详解

    2021-02-28 18:12:21
  • python检测空间储存剩余大小和指定文件夹内存占用的实例

    2022-10-30 06:52:51
  • python和websocket构建实时日志跟踪器的步骤

    2023-08-11 08:28:20
  • aspjpeg 添加水印教程及生成缩略图教程

    2011-04-04 11:04:00
  • php动态生成函数示例

    2024-05-02 17:19:00
  • JavaScript中window.showModalDialog()用法详解

    2024-04-18 09:48:04
  • python如何将mat文件转为png

    2023-04-14 07:37:21
  • pandas 如何将字符串映射为数字

    2021-04-15 02:47:33
  • Flask框架学习笔记之表单基础介绍与表单提交方式

    2023-02-05 09:25:44
  • 桌面中心(二)数据库写入

    2023-11-18 12:26:15
  • 详解CentOS升级Python2.6到Python2.7并安装pip

    2023-06-13 18:59:45
  • 基于Python代码编辑器的选用(详解)

    2022-08-13 23:44:39
  • asp之家 网络编程 m.aspxhome.com