缺少 CMake,无法安装 dlib

一、问题描述

缺少正确配置的 CMake,导致无法成功安装 dlib

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dlib
  Running setup.py clean for dlib
  Building wheel for face-recognition-models (setup.py) ... done
  Created wheel for face-recognition-models: filename=face_recognition_models-0.3.0-py2.py3-none-any.whl  size=100566211 sha256=71a6219cb2cb737c3c5589cbd43c0d38eadb3d64e01dc321c38e4f123cc88721
  Stored in directory: /root/.cache/pip/wheels/04/52/ec/9355da79c29f160b038a20c784db2803c2f9fa2c8a462c176a
Successfully built omagent_core func-timeout jsonpath wikipedia face-recognition-models
Failed to build dlib
ERROR: Failed to build installable wheels for some pyproject.toml based projects (dlib)

或者

      subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-8zeluddm/dlib_43702e1b07ce418a82086035bea97626/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-8zeluddm/dlib_43702e1b07ce418a82086035bea97626/build/lib.linux-x86_64-cpython-311', '-DPYTHON_EXECUTABLE=/opt/conda/envs/omagent/bin/python', '-DDLIB_USE_FFMPEG=OFF', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
      [end of output]
 
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dlib
  Running setup.py clean for dlib
Successfully built omagent_core
Failed to build dlib
ERROR: Failed to build installable wheels for some pyproject.toml based projects (dlib)

二、解决方案

参考安装dlib包报错解决_building wheel for dlib (pyproject.toml) did not r-优快云博客

1. 重新安装 CMake

sudo apt-get update
sudo apt-get install cmake -y

2. 安装必要的编译库

sudo apt-get install build-essential cmake libboost-all-dev libopenblas-dev liblapack-dev -y

3. 添加环境变量

sudo vim ~/.bashrc

4. 按 i写入以下内容:

export PATH="/usr/local/bin:$PATH"

5. ESC 退出写入,: wq 退出文件,运行下述内容使其生效

source ~/.bashrc

6. 重新安装

conda install -c https://conda.anaconda.org/conda-forge dlib -y
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

伪_装

您的支持,是我持续创作的光

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值