安装dlib包报错解决

文章讲述了用户在尝试在Windows环境下使用pip安装dlib时遇到的错误,主要问题是缺少VisualStudioC++编译器。给出了三种可能的解决方案:安装VisualStudio,更新CMake,或者直接下载预编译的.whl文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装dlib出现以下问题

(suanfa) PS D:\file\code> pip install dlib
Collecting dlib
  Downloading dlib-19.24.2.tar.gz (11.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.8/11.8 MB 3.5 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
  ╰─> [73 lines of output]
      running bdist_wheel
      running build
      running build_ext
      <string>:125: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      Building extension for Python 3.9.18 (main, Sep 11 2023, 14:09:26) [MSC v.1916 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\13301\AppData\Local\Temp\pip-install-0krv98w2\dlib_d734e3d0865e402592f3db3e3fb65f7c\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\13301\AppData\Local\Temp\pip-install-0krv98w2\dl
ib_d734e3d0865e402592f3db3e3fb65f7c\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=E:\Anaconda\envs\suanfa\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\13301\AppData\Local\Temp\pip-install-0krv98w2\dlib_d734e3d0865e402592f3db3e3fb65f7c\build\lib.win-amd64-cpython-39 -A x64'
      -- Building for: NMake Makefiles
      CMake Error at CMakeLists.txt:5 (message):



        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


        You must use Visual Studio to build a python extension on windows.  If you
        are getting this error it means you have not installed Visual C++.  Note
        that there are many flavors of Visual Studio, like
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

鷇韩

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值