abdeladim-s / pywhispercpp

Python bindings for whisper.cpp
https://abdeladim-s.github.io/pywhispercpp/
MIT License
129 stars 15 forks source link

Can't install #38

Open JUNIORCO opened 3 weeks ago

JUNIORCO commented 3 weeks ago

Trying to use poetry to install this on a Raspberry Pi 5 running Ubuntu. Getting this error:

$ poetry add pywhispercpp
Using version ^1.2.0 for pywhispercpp

Updating dependencies
Resolving dependencies... (0.4s)

Package operations: 1 install, 0 updates, 0 removals

  - Installing pywhispercpp (1.2.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-312
  creating build/lib.linux-aarch64-cpython-312/pywhispercpp
  copying ./pywhispercpp/constants.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp
  copying ./pywhispercpp/utils.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp
  copying ./pywhispercpp/__init__.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp
  copying ./pywhispercpp/model.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp
  copying ./pywhispercpp/_logger.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp
  creating build/lib.linux-aarch64-cpython-312/pywhispercpp/examples
  copying ./pywhispercpp/examples/livestream.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp/examples
  copying ./pywhispercpp/examples/__init__.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp/examples
  copying ./pywhispercpp/examples/assistant.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp/examples
  copying ./pywhispercpp/examples/main.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp/examples
  copying ./pywhispercpp/examples/recording.py -> build/lib.linux-aarch64-cpython-312/pywhispercpp/examples
  running build_ext
  -- The C compiler identification is GNU 13.2.0
  -- The CXX compiler identification is GNU 13.2.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - 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: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Deprecation Warning at pybind11/CMakeLists.txt:8 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  -- pybind11 v2.9.2 
  CMake Warning (dev) at pybind11/tools/FindPythonLibsNew.cmake:98 (find_package):
    Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
    are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
    the cmake_policy command to set the policy and suppress this warning.

  Call Stack (most recent call first):
    pybind11/tools/pybind11Tools.cmake:50 (find_package)
    pybind11/tools/pybind11Common.cmake:206 (include)
    pybind11/CMakeLists.txt:200 (include)
  This warning is for project developers.  Use -Wno-dev to suppress it.

  -- Found PythonInterp: /tmp/tmpcazsyxas/.venv/bin/python (found version "3.12.3")
  -- Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython3.12.so
  -- Performing Test HAS_FLTO
  -- Performing Test HAS_FLTO - Success
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
  -- Found Threads: TRUE
  -- CMAKE_SYSTEM_PROCESSOR: aarch64
  -- ARM detected
  -- Configuring done (1.7s)
  CMake Error at whisper.cpp/CMakeLists.txt:468 (add_library):
    Cannot find source file:

      ggml.h

    Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
    .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
    .f95 .f03 .hip .ispc

  CMake Error at whisper.cpp/CMakeLists.txt:468 (add_library):
    No SOURCES given to target: whisper

  CMake Generate step failed.  Build files cannot be regenerated correctly.
  Traceback (most recent call last):
    File "/home/peach/.local/share/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
      main()
    File "/home/peach/.local/share/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/peach/.local/share/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 271, in build_wheel
      return _build_backend().build_wheel(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 410, in build_wheel
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 132, in <module>
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
      dist.run_commands()
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 91, in run
      _build_ext.run(self)
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
      self.build_extensions()
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 479, in build_extensions
      self._build_extensions_serial()
    File "/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 505, in _build_extensions_serial
      self.build_extension(ext)
    File "<string>", line 118, in build_extension
    File "/usr/lib/python3.12/subprocess.py", line 571, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['cmake', '/tmp/tmpe4b649x2/pywhispercpp-1.2.0', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/tmpe4b649x2/pywhispercpp-1.2.0/build/lib.linux-aarch64-cpython-312/', '-DPYTHON_EXECUTABLE=/tmp/tmpcazsyxas/.venv/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DEXAMPLE_VERSION_INFO=1.2.0', '-GNinja', '-DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/tmpcazsyxas/.venv/lib/python3.12/site-packages/ninja/data/bin/ninja']' returned non-zero exit status 1.

  at ~/.local/share/pipx/venvs/poetry/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with pywhispercpp (1.2.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pywhispercpp (==1.2.0)"'.
abdeladim-s commented 3 weeks ago

@JUNIORCO, try to clone the project locally and use pip to install it instead.