bug: Cannot locate libctranslate2.so.4 when repairing Python wheel
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 4.7k
- Forks
- 536
- Avg merge
- 12h 12m
- Merged PRs (30d)
- 4
Description
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:
- Build the wheel:
python -m pip wheel . -w dist
- 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 viasetup.pyor ensure the shared libraries are installed in a system library path during CI builds.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with python -m pip wheel . -w dist and auditwheel repair, then inspect the wheel packaging configuration and Linux build setup for how libctranslate2.so.4 is made available. Done means auditwheel can repair the wheel and the resulting Linux wheel installs and imports successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100