首页 > 其他分享 >dlib安装问题:ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based p

dlib安装问题:ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based p

时间:2024-06-12 15:11:26浏览次数:14  
标签:wheel pyproject based Python 虚拟环境 build install dlib

 

 

# 问题安装报错。 

>pip install dlib
Defaulting to user installation because normal site-packages is not writeable
Collecting dlib
  Downloading dlib-19.24.4.tar.gz (3.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 1.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: dlib
  Building wheel for dlib (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for dlib (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      running bdist_wheel
      running build
      running build_ext

      ERROR: CMake must be installed to build dlib

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dlib
Failed to build dlib
ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects  ’

 

建议使用虚拟环境,太麻烦

 

这段文字是关于如何在Python环境下安装dlib库的指南,并且提到了针对不同Python版本和操作系统的解决方案。以下是详细解释:

1. **Python版本兼容性**:作者指出这个解决方案适用于Python 3.7、3.8和3.9版本。这意味着提供的安装方法在这些版本的Python上经过了测试并可以正常工作。

2. **创建虚拟环境**:建议使用`venv`模块或者Anaconda来创建一个虚拟环境。虚拟环境允许你为不同的项目创建隔离的Python运行环境,避免依赖冲突。

   使用`venv`创建虚拟环境的命令示例:
   ```bash
   python -m venv myenv
   ```
   
   使用Anaconda创建虚拟环境的命令示例:
   ```bash
   conda create -n my_env python=3.8
   ```

3. **下载wheel文件**:作者提到从一个特定的GitHub仓库下载预编译的dlib wheel文件。Wheel文件是Python的二进制分发格式,可以加速安装过程,因为它避免了编译步骤。

4. **安装dlib**:在终端中使用pip命令安装下载的wheel文件。示例命令格式如下:
   ```bash
   python -m pip install dlib-19.22.99-cp38-cp38-win_amd64.whl
   ```
   这里的`dlib-19.22.99-cp38-cp38-win_amd64.whl`是wheel文件的名称,表明它是为Python 3.8(`cp38`)在Windows 64位系统(`win_amd64`)上编译的。

5. **更新信息**:
   - **2023年12月更新**:提到如果用户在为dlib构建wheel时遇到问题,可以使用另一个包含Python 3.10和3.11 wheel文件的GitHub仓库。
   - **2024年5月更新**:该仓库现在也包含了Python 3.12的wheel文件。

6. **系统限制**:最后,作者注明这些wheel文件只能用来在Windows 64位操作系统上安装dlib。 

 

 可行的安装方法;

https://github.com/davisking/dlib/issues/2943

 

pip install cmake==3.25.2  -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install dlib==19.24.2  -i https://pypi.tuna.tsinghua.edu.cn/simple

 

 

 

标签:wheel,pyproject,based,Python,虚拟环境,build,install,dlib
From: https://www.cnblogs.com/flyingsir/p/18243986

相关文章

  • CBT-LLM: A Chinese Large Language Model for Cognitive Behavioral Therapy-based M
    本文是LLM系列文章,针对《CBT-LLM:AChineseLargeLanguageModelforCognitiveBehavioralTherapy-basedMentalHealthQuestionAnswering》的翻译。CBT-LLM:一个基于认知行为治疗的心理健康问答的中文大语言模型摘要1引言2相关工作3方法4实验5结论和未......
  • 《Optimizing the LINPACK Algorithm for Large-Scale PCIe-Based CPU-GPU Heterogene
    论文标题《OptimizingtheLINPACKAlgorithmforLarge-ScalePCIe-BasedCPU-GPUHeterogeneousSystems》为基于PCIe的大规模CPU-GPU异构系统优化LINPACK算法作者GuangmingTan、ChaoyangShui、YinshanWang、XianzhiYu和YujinYan来自中科院计算所初读摘要......
  • Zabbix 7.0 LTS OVF (build with LNMP based on Rocky 8.10) - VMware 虚拟机模板
    Zabbix7.0LTSOVF(buildwithLNMPbasedonRocky8.10)-VMware虚拟机模板Zabbix7.0LTS|企业级开源监控解决方案请访问原文链接:https://sysin.org/blog/zabbix-7-ovf/,查看最新版。原创作品,转载请保留出处。作者主页:sysin.orgZabbix简介全方位监控获取整个IT......
  • 腾讯冷启动论文阅读《Enhancing User Interest based on Stream Clustering and Memor
    背景用户冷启动一直是推荐系统中的一个难题,新用户(或非活跃用户)由于缺少行为数据,模型预估不准确。为了改善用户冷启动,腾讯提出了UserInterestEnhancement(UIE)模型(论文中提到也可以用于item的冷启动)。基本思想是先对用户聚类,然后用userembedding检索最相似的k个聚类中心来表示......
  • codeforces 1442 D Codeforces Round 681 (Div. 1, based on VK Cup 2019-2020 - Fina
    链接大意就是给你n组物品,这n组物品里面每组有\(t_i\)个,且他们是按照价值不降的顺序排列的。现在允许取k个物品,每个物品必须取在数组的开头处,每个物品在被取用后就会消失。问你最大能够拿到多少价值的物品。其中\(n,k\leq1500,\sumt_i\leq1e6,a_i\leq1e8\)很背包吧。可......
  • [论文速览] Design and Development of a Framework For Stroke-Based Handwritten Gu
    1.Pretitle:DesignandDevelopmentofaFrameworkForStroke-BasedHandwrittenGujaratiFontGenerationsource:arXiv2024paper:https://arxiv.org/abs/2404.03277code:None关键词:fontgeneration,handwritten,gujarati,stroke阅读理由:刷新鲜论文ing2.Mo......
  • 使用Pyftpdlib库搭建一个FTP服务器
    安装Pyftpdlib库pipinstallpyftpdlib 一键开启(本地直接开启一个简单的FTP服务器)访问 ftp://127.0.0.1:2121(默认IP为 127.0.0.1 、端口为 2121 )python-mpyftpdlib  可选参数-i 指定IP地址(默认为本机的IP地址)-p 指定端口(默认为2121)-w 写权限(默认为......
  • [论文笔记] The Fact Selection Problem in LLM-Based Program Repair
    Introduction:当bug发生时,我们会拿到很多信息:上下文、报错信息等等,文章把这些东西定义为facts,自然产生一个问题:“哪种facts应该被组织进prompt?”这篇文章就这一点做出了一些探讨。之前的工作研究了很多独立的信息,比如上下文、GitHubissue(这也行?)、栈跟踪信息;这篇文章将它......
  • Mask DINO: Towards A Unified Transformer-based Framework for Object Detection an
    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布!ProceedingsoftheIEEE/CVFConferenceonComputerVisionandPatternRecognition.2023. Abstract在本文中,我们提出了一个统一的对象检测和分割框架MaskDINO。MaskDINO通过添加一个支持所有图像分割任务(例如......
  • 【MinIO】SpringBoot引入MinIO依赖遇到的一些问题:okhttp、kotlib-stdlib
    参考官方文档SDK:https://docs.min.io/docs/java-client-quickstart-guide.htmlMinIOJavaSDKisSimpleStorageService(akaS3)clienttoperformbucketandobjectoperationstoanyAmazonS3compatibleobjectstorageservice.MinIO依赖jar包下载地址:CentralReposi......