CentOS 安装dlib 常见错误

编译高版本的cmake,centos自带的不给力。单独安装

# 安装 高版本 cmake
wget https://github.com/Kitware/CMake/releases/download/v3.18.3/cmake-3.18.3.tar.gz
tar xf cmake-3.18.3.tar.gz
cd cmake-3.18.3/
./bootstrap && make && make install
ln -s /usr/local/bin/cmake /usr/bin/cmake
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
CMake Error at Utilities/cmcurl/CMakeLists.txt:485 (message):
  Could not find OpenSSL.  Install an OpenSSL development package or
  configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.

— 安装OpenSSLyum install openssl-devel

CentOS 8 安装 dlib,先安装 devel ,根据本机对应的Python版本安装。不然会出现 找不到 python.h 的情况。
建议直接从源代码安装最新版本。版本可以从 https://pypi.org/simple/dlib/ 查看

[root@MiWiFi-R1CM-srv cmake-3.18.3]# ./bootstrap && make && make install
---------------------------------------------
CMake 3.18.3, Copyright 2000-2020 Kitware, Inc. and Contributors
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C compiler on this system.
Please specify one using environment variable CC.
See cmake_bootstrap.log for compilers attempted.

---------------------------------------------
Log of errors: /opt/cmake-3.18.3/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

没有安装c编译器。运行 yum install make gcc-c++ libstdc++-devel

/tmp/pip-install-6fdvfz6_/dlib/dlib/external/pybind11/include/pybind11/detail/common.h:111:10: 致命错误:Python.h:No such file or directory
     #include <Python.h>
              ^~~~~~~~~~
    编译中断。
    编译中断。
    

没有安装 python3-devel

yum install -y python3-devel
wget https://files.pythonhosted.org/packages/a4/7b/2f7f29f460629a8143b2deea1911e2fb1d9d88d29bf645ba321461588e88/dlib-19.21.0.tar.gz#sha256=e79d8e14171b8446d6b5434d7dc3b44a23ca05c8f99266acaf731cc7b268edb6

tar xf dlib-19.21.0.tar.gz

cd dlib-19.21.0

python setup.py install

其他版本可以查看:https://pypi.org/simple/dlib/


MacOS 下安装 dlib,需要现有 cmke,

# 用 brew 安装cnake
brew install cmake
pip3 install dlib

成功安装

➜  ~ pip3 install dlib
Collecting dlib
  Using cached dlib-19.21.0.tar.gz (3.2 MB)
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... done
  Created wheel for dlib: filename=dlib-19.21.0-cp38-cp38-macosx_10_15_x86_64.whl size=3290419 sha256=2b3b081c4e4c243a43f1dee2f64e7dbdbdb65671cbf7a2a264281d5534f0c0de
  Stored in directory: /Users/fanshengshuai/Library/Caches/pip/wheels/3a/4e/b6/77346839e430150a62d9b46bf7e0a37181fe01fd07d5d452a7
Successfully built dlib
Installing collected packages: dlib
Successfully installed dlib-19.21.0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值