问答墙

安装 dlib 时,都会收到以下报错

朋远方 发布于 1个月前 分类:提问

安装 dlib 时,都会收到以下

 × Building wheel for dlib (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [78 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.11.4 (tags/v3.11.4:d2340ef, Jun  7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\Jack\AppData\Local\Temp\pip-install-tl9fdcf0\dlib_fee2183dfbb9404395bfedaca5728c1a\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Jack\AppData\Local\Temp\pip-install-tl9fdcf0\dlib_fee2183dfbb9404395bfedaca5728c1a\build\lib.win-amd64-cpython-311 -DPYTHON_EXECUTABLE=C:\Users\Jack\AppData\Local\Programs\Python\Python311\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Jack\AppData\Local\Temp\pip-install-tl9fdcf0\dlib_fee2183dfbb9404395bfedaca5728c1a\build\lib.win-amd64-cpython-311 -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 Visual Studio for C#
        development.  You need to install Visual Studio for C++.


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

2个回复

  • 朋远方的头像

    https://github.com/sachadee/Dlib

    1. 从此存储库下载适合您的特定 Python 版本的wheel 文件,放在项目根目录;
    2. 打开终端并通过以下方式安装 Dlib:
    python -m pip install dlib-19.22.99-cp38-cp38-win_amd64.whl 
  • 朋远方的头像

    参考论坛网址:https://stackoverflow.com/questions/76629574/error-could-not-build-wheels-for-dlib-which-is-required-to-install-pyproject