Skip to content

bug: Cannot locate libctranslate2.so.4 when repairing Python wheel #1919

@yzewei

Description

@yzewei

Description:
When building the CTranslate2 wheel on Linux, running auditwheel repair fails because it cannot locate the shared library, preventing the wheel from being properly packaged and installed.

Platform and OS:

  • Platform: x86_64
  • OS: Fedora 41

Steps to reproduce:

  1. Build the wheel:
python -m pip wheel . -w dist
  1. Attempt to repair the wheel:
auditwheel repair dist/ctranslate2-4.6.0-cp311-cp311-linux_x86_64.whl

Error message:

INFO:auditwheel.main_repair:Repairing ctranslate2-4.6.0-cp311-cp311-linux_x86_64.whl
INFO:auditwheel.wheel_abi:setting libc to glibc
Traceback (most recent call last):
  File "/usr/local/bin/auditwheel", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/auditwheel/main.py", line 53, in main
    result: int | None = args.func(args, p)
                         ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/auditwheel/main_repair.py", line 255, in execute
    out_wheel = repair_wheel(
                ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/auditwheel/repair.py", line 89, in repair_wheel
    raise ValueError(msg)
ValueError: Cannot repair wheel, because required library "libctranslate2.so.4" could not be located

Additional information / Suggestions:

  • This issue occurs on Linux and may cause the installed wheel to fail on import.
  • A possible solution is to include libctranslate2.so, libctranslate2.so.4, etc., in the wheel via setup.py or ensure the shared libraries are installed in a system library path during CI builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions