davisking / dlib

A toolkit for making real world machine learning and data analysis applications in C++
http://dlib.net
Boost Software License 1.0
13.59k stars 3.38k forks source link

[Bug]: Failed building wheel for dlib #3009

Closed Razi0wdx closed 3 weeks ago

Razi0wdx commented 2 months ago

What Operating System(s) are you seeing this problem on?

Windows

dlib version

not installed

Python version

3.11

Compiler

vsc

Expected Behavior

I want to install the dlib and face_recognition libraries.

Current Behavior

Collecting dlib Using cached dlib-19.24.6.tar.gz (3.4 MB) 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 ╰─> [80 lines of output] running bdist_wheel running build running build_ext

:163: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. Building extension for Python 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] Invoking CMake setup: 'cmake C:\Users\razie\AppData\Local\Temp\pip-install-5k9xar4h\dlib_fcd6814660264bdb9de076487b2bc17e\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\razie\AppData\Local\Temp\pip-install-5k9xar4h\dlib_fcd6814660264bdb9de076487b2bc17e\build\lib.win-amd64-cpython-311 -DPYTHON_EXECUTABLE=C:\Users\razie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe -DDLIB_USE_FFMPEG=OFF -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\razie\AppData\Local\Temp\pip-install-5k9xar4h\dlib_fcd6814660264bdb9de076487b2bc17e\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++. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -- Configuring incomplete, errors occurred! Traceback (most recent call last): File "C:\Users\razie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in main() File "C:\Users\razie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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\razie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\build_meta.py", line 421, in build_wheel return self._build_with_temp_dir( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\build_meta.py", line 403, in _build_with_temp_dir self.run_setup() File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\build_meta.py", line 503, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup exec(code, locals()) File "", line 243, in File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\__init__.py", line 117, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands dist.run_commands() File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands self.run_command(cmd) File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\dist.py", line 950, in run_command super().run_command(command) File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command cmd_obj.run() File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\command\bdist_wheel.py", line 384, in run self.run_command("build") File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command self.distribution.run_command(command) File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\dist.py", line 950, in run_command super().run_command(command) File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command cmd_obj.run() File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run self.run_command(cmd_name) File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command self.distribution.run_command(command) File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\dist.py", line 950, in run_command super().run_command(command) File "C:\Users\razie\AppData\Local\Temp\pip-build-env-aqg1_hy2\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command cmd_obj.run() File "", line 168, in run File "", line 206, in build_extension File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\razie\\AppData\\Local\\Temp\\pip-install-5k9xar4h\\dlib_fcd6814660264bdb9de076487b2bc17e\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\razie\\AppData\\Local\\Temp\\pip-install-5k9xar4h\\dlib_fcd6814660264bdb9de076487b2bc17e\\build\\lib.win-amd64-cpython-311', '-DPYTHON_EXECUTABLE=C:\\Users\\razie\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\python.exe', '-DDLIB_USE_FFMPEG=OFF', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\razie\\AppData\\Local\\Temp\\pip-install-5k9xar4h\\dlib_fcd6814660264bdb9de076487b2bc17e\\build\\lib.win-amd64-cpython-311', '-A', 'x64']' 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: ERROR: Failed to build installable wheels for some pyproject.toml based projects (dlib) PS C:\Users\razie> ### Steps to Reproduce bruh ### Anything else? _No response_
davisking commented 2 months ago

From the comment you posted :)

    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++.
dlib-issue-bot commented 1 month ago

Warning: this issue has been inactive for 35 days and will be automatically closed on 2024-10-29 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

dlib-issue-bot commented 3 weeks ago

Notice: this issue has been closed because it has been inactive for 55 days. You may reopen this issue if it has been closed in error.