Chatterbox-TTS-Server icon indicating copy to clipboard operation
Chatterbox-TTS-Server copied to clipboard

Building wheel for onnx (pyproject.toml) did not run successfully - Mac M2

Open Lordhacker756 opened this issue 1 year ago • 2 comments

I'm on Mac M2 with Python 3.13.2, and I'm getting this error while I'm trying to install the dependencies using

pip install -r requirements.txt

After I've already activated the venv

Building wheel for onnx (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for onnx (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [113 lines of output] :31: DeprecationWarning: Use shutil.which instead of find_executable :32: DeprecationWarning: Use shutil.which instead of find_executable fatal: not a git repository (or any of the parent directories): .git /private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg) running bdist_wheel running build running build_py running create_version running cmake_build Using cmake args: ['/opt/homebrew/bin/cmake', '-DPYTHON_INCLUDE_DIR=/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.13/include/python3.13', '-DPYTHON_EXECUTABLE=/Users/eren/Desktop/Moe-Ment/tts-service/venv/bin/python3.13', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-313-darwin.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-install-n3e18rle/onnx_58746e697570483dac663a2a040cbf0d'] CMake Error at CMakeLists.txt:2 (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.
  
    Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
  
  
  -- Configuring incomplete, errors occurred!
  Traceback (most recent call last):
    File "/Users/eren/Desktop/Moe-Ment/tts-service/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
      main()
      ~~~~^^
    File "/Users/eren/Desktop/Moe-Ment/tts-service/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
                               ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/eren/Desktop/Moe-Ment/tts-service/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
      return _build_backend().build_wheel(
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
          wheel_directory, config_settings, metadata_directory
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      )
      ^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 435, in build_wheel
      return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 423, in _build
      return self._build_with_temp_dir(
             ~~~~~~~~~~~~~~~~~~~~~~~~~^
          cmd,
          ^^^^
      ...<3 lines>...
          self._arbitrary_args(config_settings),
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      )
      ^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 404, in _build_with_temp_dir
      self.run_setup()
      ~~~~~~~~~~~~~~^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 512, in run_setup
      super().run_setup(setup_script=setup_script)
      ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 317, in run_setup
      exec(code, locals())
      ~~~~^^^^^^^^^^^^^^^^
    File "<string>", line 332, in <module>
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/__init__.py", line 115, in setup
      return distutils.core.setup(**attrs)
             ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 186, in setup
      return run_commands(dist)
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
      dist.run_commands()
      ~~~~~~~~~~~~~~~~~^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
      self.run_command(cmd)
      ~~~~~~~~~~~~~~~~^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1102, in run_command
      super().run_command(command)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
      ~~~~~~~~~~~^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/command/bdist_wheel.py", line 370, in run
      self.run_command("build")
      ~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
      self.distribution.run_command(command)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1102, in run_command
      super().run_command(command)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
      ~~~~~~~~~~~^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
      ~~~~~~~~~~~~~~~~^^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
      self.distribution.run_command(command)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1102, in run_command
      super().run_command(command)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
      ~~~~~~~~~~~^^
    File "<string>", line 223, in run
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
      self.distribution.run_command(command)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1102, in run_command
      super().run_command(command)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-build-env-w_dv947z/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
      ~~~~~~~~~~~^^
    File "<string>", line 209, in run
    File "/opt/homebrew/Cellar/[email protected]/3.13.3_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 419, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/opt/homebrew/bin/cmake', '-DPYTHON_INCLUDE_DIR=/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.13/include/python3.13', '-DPYTHON_EXECUTABLE=/Users/eren/Desktop/Moe-Ment/tts-service/venv/bin/python3.13', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-313-darwin.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/private/var/folders/pn/wtpm88t51v17rtg7q0l_7yf80000gn/T/pip-install-n3e18rle/onnx_58746e697570483dac663a2a040cbf0d']' 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 onnx Successfully built chatterbox-tts Failed to build onnx ERROR: Failed to build installable wheels for some pyproject.toml based projects (onnx)

Lordhacker756 avatar Jun 15 '25 09:06 Lordhacker756

I've encountered the same issue on Windows. First tried to downgrade cmake from the 4.x version to 3.31.8, which circumvented the original problem of Compatibility with CMake < 3.5 has been removed from CMake. In the end it still failed - what resolved it for me was downgrading from python 3.12 to 3.10.

HendrikLeuschner avatar Jun 15 '25 12:06 HendrikLeuschner

Fixed in commit a67348a. The root cause was that chatterbox-tts pulled in s3tokenizer which depends on onnx, and pip would try to build ONNX from source on platforms without pre-built wheels — failing due to CMake/compiler issues.

The fix:

  • Chatterbox is now installed with --no-deps across all installation paths (CPU, NVIDIA, cu128, ROCm)
  • All chatterbox dependencies are listed explicitly in the requirements files
  • onnx==1.16.0 is pinned to ensure pre-built wheels are used (no source builds)

To update: git pull && python start.py --reinstall

If you still hit issues, make sure you're using Python 3.10 (recommended). Python 3.13+ is not supported.

devnen avatar Mar 26 '26 22:03 devnen