aarnphm / whispercpp

Pybind11 bindings for Whisper.cpp
Apache License 2.0
321 stars 57 forks source link

bug: linux wheel Import Error #77

Open zhqu1148980644 opened 1 year ago

zhqu1148980644 commented 1 year ago

Describe the bug

The package installed from pypi causes the following erros:

Python 3.11.2 (main, Mar 23 2023, 17:12:29) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from whispercpp import Whisper
>>>
>>> w = Whisper.from_pretrained("tiny.en")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/whispercpp/__init__.py", line 105, in from_pretrained
    context = api.Context.from_file(
              ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/whispercpp/utils.py", line 144, in __getattr__
    self._module = self._load()
                   ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/whispercpp/utils.py", line 122, in _load
    module = importlib.import_module(self.__name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 676, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 573, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1233, in create_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /usr/local/lib/python3.11/site-packages/whispercpp/api_cpp2py_export.so)

Then I rebuild the package using the latest source, the program creashed.

Python 3.11.2 (main, Mar 23 2023, 17:12:29) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from whispercpp import Whisper
>>>
>>> w = Whisper.from_pretrained("tiny.en")
Illegal instruction (core dumped)

To reproduce

  1. docker run -i -t python:3 bash
  2. pip install whispercpp
    root@495bbb253133:/# pip install whispercpp
    Collecting whispercpp
    Downloading whispercpp-0.0.17-cp311-cp311-manylinux2014_x86_64.whl (1.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 2.5 MB/s eta 0:00:00
    Installing collected packages: whispercpp
    Successfully installed whispercpp-0.0.17
  3. Run codes in readme.
  4. Rebuild and reinstall package using python3 -m build -w
  5. Run codes in readme.

Expected behavior

No response

Environment

python: 3.11 platform: x86-64 Debian GNU/Linux 11 (bullseye)

sorgfresser commented 1 year ago

Had that one too. This bug is not caused by the bindings but by whisper.cpp I suppose. It is simply linked to your Distro-Version being outdated by now. I had this first on Linux Mint Una, it was fixed by upgrading to 21.

yanchujian commented 9 months ago

Had that one too. This bug is not caused by the bindings but by whisper.cpp I suppose. It is simply linked to your Distro-Version being outdated by now. I had this first on Linux Mint Una, it was fixed by upgrading to 21.

Hello,what does the 21 version here refer to.

sorgfresser commented 9 months ago

The linux mint version 21, i.e. Vanessa. This bug should relate to some .so files being outdated. You could either manually upgrade this or dump your distro.