• DepthAI-v2
  • ERROR: Could not build wheels for depthai, (...) pyproject.toml-based projects

Hey guys,

I've been trying to resolve this error for so much time, but I got exhausted.

I also found this:

https://discuss.luxonis.com/d/1127-problem-on-m1-building-wheels-for-depthai

But I'm using Windows 11 (Python 3.12), Visual Studio Code.

Any chance that anyone knows how to resolve this?

Please let me know if I should provide further additional info.

Thanks

The ERROR:
ERROR: Could not build wheels for depthai, which is required to install pyproject.toml-based projects

Full Traceback:
(.venv) PS C:\Repositories\TestingLuxonisOAK> pip install depthai

Collecting depthai

Using cached depthai-2.24.0.0.tar.gz (434 kB)

Installing build dependencies ... done

Getting requirements to build wheel ... done

Preparing metadata (pyproject.toml) ... done

Building wheels for collected packages: depthai

Building wheel for depthai (pyproject.toml) ... error

error: subprocess-exited-with-error

× Building wheel for depthai (pyproject.toml) did not run successfully.

│ exit code: 1

╰─> [99 lines of output]

running bdist_wheel

running build

running build_ext

<string>:87: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

-- Building for: Visual Studio 17 2022

-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.

-- The C compiler identification is MSVC 19.38.33134.0

-- The CXX compiler identification is MSVC 19.38.33134.0

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped

-- Detecting C compile features

-- Detecting C compile features - done

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Generating new toolchain...

-- Using toolchain file: C:/Users/user/AppData/Local/Temp/pip-install-1hp97wif/depthai_29313ce69dbd4990b8bab27846eb18b8/build/temp.win-amd64-cpython-312/Release/depthai-core/generated/toolchain.cmake

-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.43.0.windows.1")

-- [hunter] Calculating Toolchain-SHA1

-- [hunter] Calculating Config-SHA1

-- [hunter] HUNTER_ROOT: C:/.hunter

-- [hunter] [ Hunter-ID: cb0ea1f | Toolchain-ID: cc23a32 | Config-ID: 23ffacf ]

[hunter ** INTERNAL **] vcvarsall.bat not found in `C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/VC/Auxiliary/Build`

[hunter ** INTERNAL **] [Directory:C:/Users/user/AppData/Local/Temp/pip-install-1hp97wif/depthai_29313ce69dbd4990b8bab27846eb18b8/depthai-core/cmake]

------------------------------ ERROR -----------------------------

https://hunter.readthedocs.io/en/latest/reference/errors/error.internal.html

------------------------------------------------------------------

CMake Error at C:/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):

Call Stack (most recent call first):

C:/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/modules/hunter_internal_error.cmake:13 (hunter_error_page)

C:/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/modules/hunter_setup_msvc.cmake:229 (hunter_internal_error)

C:/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/modules/hunter_finalize.cmake:117 (hunter_setup_msvc)

C:/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/modules/hunter_add_package.cmake:23 (hunter_finalize)

depthai-core/cmake/depthaiDependencies.cmake:11 (hunter_add_package)

depthai-core/CMakeLists.txt:170 (include)

-- Configuring incomplete, errors occurred!

See also "C:/Users/user/AppData/Local/Temp/pip-install-1hp97wif/depthai_29313ce69dbd4990b8bab27846eb18b8/build/temp.win-amd64-cpython-312/Release/CMakeFiles/CMakeOutput.log".

Traceback (most recent call last):

File "c:\Repositories\TestingLuxonisOAK\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>

main()

File "c:\Repositories\TestingLuxonisOAK\.venv\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:\Repositories\TestingLuxonisOAK\.venv\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\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\build_meta.py", line 404, in build_wheel

return self._build_with_temp_dir(

^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\build_meta.py", line 389, in _build_with_temp_dir

self.run_setup()

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup

super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup

exec(code, locals())

File "<string>", line 198, in <module>

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup

return distutils.core.setup(**attrs)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup

return run_commands(dist)

^^^^^^^^^^^^^^^^^^

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands

dist.run_commands()

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands

self.run_command(cmd)

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\dist.py", line 963, in run_command

super().run_command(command)

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command

cmd_obj.run()

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 368, in run

self.run_command("build")

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command

self.distribution.run_command(command)

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\dist.py", line 963, in run_command

super().run_command(command)

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command

cmd_obj.run()

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run

self.run_command(cmd_name)

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command

self.distribution.run_command(command)

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\dist.py", line 963, in run_command

super().run_command(command)

File "C:\Users\user\AppData\Local\Temp\pip-build-env-7jba5zjl\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command

cmd_obj.run()

File "<string>", line 92, in run

File "<string>", line 195, in build_extension

File "c:\Python-3-12\Lib\subprocess.py", line 413, in check_call

raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-1hp97wif\\depthai_29313ce69dbd4990b8bab27846eb18b8', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-1hp97wif\\depthai_29313ce69dbd4990b8bab27846eb18b8\\build\\lib.win-amd64-cpython-312\\', '-DPYTHON_EXECUTABLE=c:\\Repositories\\TestingLuxonisOAK\\.venv\\Scripts\\python.exe', '-DCMAKE_BUILD_TYPE=Release', '-DHUNTER_CONFIGURATION_TYPES=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-1hp97wif\\depthai_29313ce69dbd4990b8bab27846eb18b8\\build\\lib.win-amd64-cpython-312\\', '-DCMAKE_TOOLCHAIN_FILE=C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-1hp97wif\\depthai_29313ce69dbd4990b8bab27846eb18b8/cmake/toolchain/msvc.cmake', '-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 depthai

Failed to build depthai

ERROR: Could not build wheels for depthai, which is required to install pyproject.toml-based projects

    • Best Answerset by lerp

    jakaskerl

    Hey, thanks for the info!

    I've tried now Python 3.11.7 and it suddenly worked:

    (.venv) PS C:\Repositories\TestingLuxonisOAK> pip install depthai

    Collecting depthai

    Using cached depthai-2.24.0.0-cp311-cp311-win_amd64.whl.metadata (8.9 kB)

    Using cached depthai-2.24.0.0-cp311-cp311-win_amd64.whl (10.4 MB)

    Installing collected packages: depthai

    Successfully installed depthai-2.24.0.0

    (.venv) PS C:\Repositories\TestingLuxonisOAK>

    On the other hand, I have also installed Microsoft Build Tools + Microsoft Visual Studio.

    I used Visual Studio Installer, so maybe it helped fix issues with CMake or such.

Hi @lerp
Depthai was not supported for python 3.12 a week ago. Perhaps some wheels were not built on the artifactory.

Could you try manually installing the wheel from here. pip install [wheel file]. This one if for x86 so if you are running windows on ARM, we don't have wheels for that.

Thanks,
Jaka

  • lerp replied to this.

    jakaskerl

    Hey, thanks for the info!

    I've tried now Python 3.11.7 and it suddenly worked:

    (.venv) PS C:\Repositories\TestingLuxonisOAK> pip install depthai

    Collecting depthai

    Using cached depthai-2.24.0.0-cp311-cp311-win_amd64.whl.metadata (8.9 kB)

    Using cached depthai-2.24.0.0-cp311-cp311-win_amd64.whl (10.4 MB)

    Installing collected packages: depthai

    Successfully installed depthai-2.24.0.0

    (.venv) PS C:\Repositories\TestingLuxonisOAK>

    On the other hand, I have also installed Microsoft Build Tools + Microsoft Visual Studio.

    I used Visual Studio Installer, so maybe it helped fix issues with CMake or such.

    a month later

    Hello,

    I'm using python 3.11.1 and I'm facing the same problem also I m on windows so the wheel file solution doesn't work for me what can I do?