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
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python K最近邻从原理到实现的方法
![](https://img.aspxhome.com/file/2023/0/90770_0s.png)
layer页面跳转,获取html子节点元素的值方法
基于python+selenium的二次封装的实现
![](https://img.aspxhome.com/file/2023/1/102961_0s.png)
mysql建表常用sql语句个人经验分享
重新编译PLSQL中的无效对象或者指定的对象 的方法
Python动态加载模块的3种方法
python线程优先级队列知识点总结
详解mysql数据库增删改操作
![](https://img.aspxhome.com/file/2023/6/66596_0s.png)
Python importlib模块重载使用方法详解
python检测空间储存剩余大小和指定文件夹内存占用的实例
python和websocket构建实时日志跟踪器的步骤
![](https://img.aspxhome.com/file/2023/7/115697_0s.gif)
aspjpeg 添加水印教程及生成缩略图教程
php动态生成函数示例
JavaScript中window.showModalDialog()用法详解
python如何将mat文件转为png
pandas 如何将字符串映射为数字
Flask框架学习笔记之表单基础介绍与表单提交方式
![](https://img.aspxhome.com/file/2023/2/103542_0s.png)
桌面中心(二)数据库写入
详解CentOS升级Python2.6到Python2.7并安装pip
基于Python代码编辑器的选用(详解)
![](https://img.aspxhome.com/file/2023/8/131678_0s.png)