试图在我的 Windows 10 上安装 dlib,但出现子进程错误

问题描述 投票:0回答:0

嘿,我试图在我的 Windows 10 上安装 dlib,但在安装时出现错误。我已经安装了 visual studio 和 cmake,之后我尝试安装 dlib。但是出现子流程错误。

   C:\Users\sumit\AppData\Local\Temp\pip-install-p66zbcs7\dlib_4f9a7f7b392f441f921895b4399bd7c7\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2
338: static_assert failed: 'ssize_t != Py_intptr_t' (compiling source file C:\Users\sumit\AppData\Local\Temp\pip-install-p66zbcs7\dlib_4f9a7f7b392f441f921895b4399b
d7c7\tools\python\src\gui.cpp) [C:\Users\sumit\AppData\Local\Temp\pip-install-p66zbcs7\dlib_4f9a7f7b392f441f921895b4399bd7c7\build\temp.win-amd64-cpython-311\Relea
se\dlib_python.vcxproj]
      Traceback (most recent call last):
        File "c:\users\sumit\appdata\local\programs\python\python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <modul
e>
          main()
        File "c:\users\sumit\appdata\local\programs\python\python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main  
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "c:\users\sumit\appdata\local\programs\python\python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_
wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\build_meta.py", line 413, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\build_meta.py", line 398, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\build_meta.py", line 485, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 223, in <module>
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\__init__.py", line 108, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\dist.py", line 1221, in run_command
          super().run_command(command)
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "C:\Users\sumit\AppData\Local\Temp\pip-build-env-9r7160n8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' 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
Failed to build dlib
ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects

我也尝试在从 chrome 下载 cmake 然后将其路径添加到环境变量后安装 dlib 但仍然出现错误

python face-recognition dlib
© www.soinside.com 2019 - 2024. All rights reserved.