Skip to content

Commit edf867b

Browse files
committed
fix(libretranslate): pin Python 3.12 for venv to ensure PyTorch compatibility
PyTorch versions below 2.5.0 don't provide wheels for Python 3.13 (cp313). Debian 13 uses Python 3.13 by default, causing the installation to fail with 'no wheels with a matching Python ABI tag'. Use uv venv --python 3.12 to create the virtual environment with Python 3.12, ensuring compatibility with all PyTorch versions. Fixes libretranslate installation on Debian 13.
1 parent e462aba commit edf867b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ct/libretranslate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function update_script() {
2929
exit
3030
fi
3131

32-
setup_uv
32+
PYTHON_VERSION="3.12" setup_uv
3333

3434
if check_for_gh_release "libretranslate" "LibreTranslate/LibreTranslate"; then
3535
msg_info "Stopping Service"
@@ -39,7 +39,7 @@ function update_script() {
3939
msg_info "Updating LibreTranslate"
4040
cd /opt/libretranslate
4141
source .venv/bin/activate
42-
$STD pip install -U libretranslate
42+
$STD uv pip install -U libretranslate
4343
msg_ok "Updated LibreTranslate"
4444

4545
msg_info "Starting Service"

install/libretranslate-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ $STD apt install -y \
3232
python3-icu
3333
msg_ok "Setup Python3"
3434

35-
setup_uv
35+
PYTHON_VERSION="3.12" setup_uv
3636
fetch_and_deploy_gh_release "libretranslate" "LibreTranslate/LibreTranslate"
3737

3838
msg_info "Setup LibreTranslate (Patience)"
@@ -42,7 +42,7 @@ if [[ -z "$TORCH_VERSION" ]]; then
4242
TORCH_VERSION="2.5.0"
4343
fi
4444
cd /opt/libretranslate
45-
$STD uv venv .venv
45+
$STD uv venv .venv --python 3.12
4646
$STD source .venv/bin/activate
4747
$STD uv pip install --upgrade pip setuptools
4848
$STD uv pip install Babel==2.12.1

0 commit comments

Comments
 (0)