From edf867b91dc850ccb1100e51f1f640a765f3f45b Mon Sep 17 00:00:00 2001 From: MickLesk Date: Fri, 5 Dec 2025 21:09:25 +0100 Subject: [PATCH] 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. --- ct/libretranslate.sh | 4 ++-- install/libretranslate-install.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ct/libretranslate.sh b/ct/libretranslate.sh index 6785a53e1ba..2c55d83800c 100644 --- a/ct/libretranslate.sh +++ b/ct/libretranslate.sh @@ -29,7 +29,7 @@ function update_script() { exit fi - setup_uv + PYTHON_VERSION="3.12" setup_uv if check_for_gh_release "libretranslate" "LibreTranslate/LibreTranslate"; then msg_info "Stopping Service" @@ -39,7 +39,7 @@ function update_script() { msg_info "Updating LibreTranslate" cd /opt/libretranslate source .venv/bin/activate - $STD pip install -U libretranslate + $STD uv pip install -U libretranslate msg_ok "Updated LibreTranslate" msg_info "Starting Service" diff --git a/install/libretranslate-install.sh b/install/libretranslate-install.sh index 47e55b66d97..d511c033c2c 100644 --- a/install/libretranslate-install.sh +++ b/install/libretranslate-install.sh @@ -32,7 +32,7 @@ $STD apt install -y \ python3-icu msg_ok "Setup Python3" -setup_uv +PYTHON_VERSION="3.12" setup_uv fetch_and_deploy_gh_release "libretranslate" "LibreTranslate/LibreTranslate" msg_info "Setup LibreTranslate (Patience)" @@ -42,7 +42,7 @@ if [[ -z "$TORCH_VERSION" ]]; then TORCH_VERSION="2.5.0" fi cd /opt/libretranslate -$STD uv venv .venv +$STD uv venv .venv --python 3.12 $STD source .venv/bin/activate $STD uv pip install --upgrade pip setuptools $STD uv pip install Babel==2.12.1