[GH-ISSUE #10458] Bazarr fails to start after Debian 13 upgrade - systemd service uses system Python instead of venv #2260

Closed
opened 2026-02-26 12:51:50 +03:00 by kerem · 2 comments
Owner

Originally created by @vidonnus on GitHub (Jan 1, 2026).
Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/10458

Have you read and understood the above guidelines?

yes

🔎 Did you run the script with verbose mode enabled?

No (this issue will likely be closed automatically)

📜 What is the name of the script you are using?

Bazarr

📂 What was the exact command used to execute the script?

n/a

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 13

📈 Which Proxmox version are you on?

9.1.4

📝 Provide a clear and concise description of the issue.

After upgrading an LXC container from Debian 12 to Debian 13, Bazarr fails to start with an "externally-managed-environment" error. This is caused by PEP 668 enforcement in Python 3.13, which prevents pip from installing packages system-wide.

Environment:

  • Proxmox VE Version: 9.1.4
  • LXC Container OS: Debian 13 (Trixie) - upgraded from Debian 12 (Bookworm)
  • Installation Method: Community Scripts (Bazarr install script)
  • Script Used: bazarr-install.sh

Root Cause:
Installations created with the Bazarr install script prior to October 28, 2025 (commit 909dbc20c) configured the systemd service file to use system Python (/usr/bin/python3) instead of the virtual environment Python (/opt/bazarr/venv/bin/python3). When Bazarr starts after upgrading to Debian 13, it attempts to install requirements using system Python 3.13, which triggers the PEP 668 protection.

Note: The installation script has been fixed as of October 28, 2025. This issue only affects existing installations created before that date.

Current (incorrect) service file:

ExecStart=/usr/bin/python3 /opt/bazarr/bazarr.py

Expected service file:

ExecStart=/opt/bazarr/venv/bin/python3 /opt/bazarr/bazarr.py

🔄 Steps to reproduce the issue.

  1. Install Bazarr using the community script before October 28, 2025 on Debian 12
  2. Upgrade the container to Debian 13 (Trixie)
  3. Attempt to start or restart Bazarr service
  4. Service fails with externally-managed-environment error

Paste the full error output (if available).

Jan 01 02:59:33 bazarr systemd[1]: Started bazarr.service - Bazarr Daemon.
Jan 01 02:59:33 bazarr bazarr[571]: Python version greater than 3.12.x is unsupported. Current version is 3.13.5. Keep in mind that even if it works, you're on your own.
Jan 01 02:59:33 bazarr bazarr[571]: Bazarr starting child process with PID 574...
Jan 01 02:59:34 bazarr bazarr[574]: 2026-01-01 02:59:34,209 - root                             (743599694100) :  INFO (init:90) - BAZARR installing requirements...
Jan 01 02:59:34 bazarr bazarr[574]: 2026-01-01 02:59:34,407 - root                             (743599694100) :  ERROR (init:99) - BAZARR requirements.txt installation result: b'error: externally-managed-environment\n\n\xc3\x97 This environment is externally managed\n\xe2\x95\xb0\xe2\x94\x80> To install Python packages system-wide, try apt install\n    python3-xyz, where xyz is the package you are trying to\n    install.\n    \n    If you wish to install a non-Debian-packaged Python package,\n    create a virtual environment using python3 -m venv path/to/venv.\n    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make\n    sure you have python3-full installed.\n    \n    If you wish to install a non-Debian packaged Python application,\n    it may be easiest to use pipx install xyz, which will manage a\n    virtual environment for you. Make sure you have pipx installed.\n    \n    See /usr/share/doc/python3.13/README.venv for more information.\n\nnote: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.\nhint: See PEP 668 for the detailed specification.\n'

🖼️ Additional context (optional).

Script Status:

  • The installation script was fixed on October 28, 2025 (commit 909dbc20c)
  • New installations now correctly use /opt/bazarr/venv/bin/python3 in the service file
  • ⚠️ This issue only affects existing installations created before the fix
  • Users who installed Bazarr before October 28, 2025 and then upgraded to Debian 13 will encounter this error

Impact:

  • Affects Bazarr installations created before October 28, 2025 that are upgraded to Debian 13
  • Prevents Bazarr from starting after OS upgrade
  • Requires manual intervention to fix

Technical Details:

  • Debian 13 ships with Python 3.13, which enforces PEP 668 more strictly
  • Bazarr officially supports Python 3.12.x and warns about 3.13+
  • Old installations (pre-October 28, 2025) created a virtual environment but the systemd service didn't use it

Workaround:

  1. Stop Bazarr: systemctl stop bazarr
  2. Install uv package manager:
    curl -LsSf https://astral.sh/uv/install.sh | sh
    export PATH="/root/.local/bin:$PATH"
    
  3. Recreate virtual environment:
    cd /opt/bazarr
    rm -rf venv  # if exists
    uv venv /opt/bazarr/venv --python 3.12
    uv pip install -r /opt/bazarr/requirements.txt --python /opt/bazarr/venv/bin/python3
    
  4. Update service file (nano /etc/systemd/system/bazarr.service):
    Change ExecStart=/usr/bin/python3 to ExecStart=/opt/bazarr/venv/bin/python3
  5. Reload and restart:
    systemctl daemon-reload
    systemctl restart bazarr
    

Related:

Originally created by @vidonnus on GitHub (Jan 1, 2026). Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/10458 ### ✅ Have you read and understood the above guidelines? yes ### 🔎 Did you run the script with verbose mode enabled? No (this issue will likely be closed automatically) ### 📜 What is the name of the script you are using? Bazarr ### 📂 What was the exact command used to execute the script? n/a ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 13 ### 📈 Which Proxmox version are you on? 9.1.4 ### 📝 Provide a clear and concise description of the issue. After upgrading an LXC container from Debian 12 to Debian 13, Bazarr fails to start with an "externally-managed-environment" error. This is caused by PEP 668 enforcement in Python 3.13, which prevents pip from installing packages system-wide. **Environment:** - **Proxmox VE Version**: 9.1.4 - **LXC Container OS**: Debian 13 (Trixie) - upgraded from Debian 12 (Bookworm) - **Installation Method**: Community Scripts (Bazarr install script) - **Script Used**: `bazarr-install.sh` **Root Cause:** Installations created with the Bazarr install script **prior to October 28, 2025** (commit `909dbc20c`) configured the systemd service file to use system Python (`/usr/bin/python3`) instead of the virtual environment Python (`/opt/bazarr/venv/bin/python3`). When Bazarr starts after upgrading to Debian 13, it attempts to install requirements using system Python 3.13, which triggers the PEP 668 protection. **Note:** The installation script has been fixed as of October 28, 2025. This issue only affects existing installations created before that date. **Current (incorrect) service file:** ```ini ExecStart=/usr/bin/python3 /opt/bazarr/bazarr.py ``` **Expected service file:** ```ini ExecStart=/opt/bazarr/venv/bin/python3 /opt/bazarr/bazarr.py ``` ### 🔄 Steps to reproduce the issue. 1. Install Bazarr using the community script **before October 28, 2025** on Debian 12 2. Upgrade the container to Debian 13 (Trixie) 3. Attempt to start or restart Bazarr service 4. Service fails with externally-managed-environment error ### ❌ Paste the full error output (if available). ``` Jan 01 02:59:33 bazarr systemd[1]: Started bazarr.service - Bazarr Daemon. Jan 01 02:59:33 bazarr bazarr[571]: Python version greater than 3.12.x is unsupported. Current version is 3.13.5. Keep in mind that even if it works, you're on your own. Jan 01 02:59:33 bazarr bazarr[571]: Bazarr starting child process with PID 574... Jan 01 02:59:34 bazarr bazarr[574]: 2026-01-01 02:59:34,209 - root (743599694100) : INFO (init:90) - BAZARR installing requirements... Jan 01 02:59:34 bazarr bazarr[574]: 2026-01-01 02:59:34,407 - root (743599694100) : ERROR (init:99) - BAZARR requirements.txt installation result: b'error: externally-managed-environment\n\n\xc3\x97 This environment is externally managed\n\xe2\x95\xb0\xe2\x94\x80> To install Python packages system-wide, try apt install\n python3-xyz, where xyz is the package you are trying to\n install.\n \n If you wish to install a non-Debian-packaged Python package,\n create a virtual environment using python3 -m venv path/to/venv.\n Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make\n sure you have python3-full installed.\n \n If you wish to install a non-Debian packaged Python application,\n it may be easiest to use pipx install xyz, which will manage a\n virtual environment for you. Make sure you have pipx installed.\n \n See /usr/share/doc/python3.13/README.venv for more information.\n\nnote: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.\nhint: See PEP 668 for the detailed specification.\n' ``` ### 🖼️ Additional context (optional). **Script Status:** - ✅ The installation script was **fixed on October 28, 2025** (commit `909dbc20c`) - ✅ New installations now correctly use `/opt/bazarr/venv/bin/python3` in the service file - ⚠️ This issue only affects **existing installations** created before the fix - Users who installed Bazarr before October 28, 2025 and then upgraded to Debian 13 will encounter this error **Impact:** - Affects Bazarr installations created before October 28, 2025 that are upgraded to Debian 13 - Prevents Bazarr from starting after OS upgrade - Requires manual intervention to fix **Technical Details:** - Debian 13 ships with Python 3.13, which enforces PEP 668 more strictly - Bazarr officially supports Python 3.12.x and warns about 3.13+ - Old installations (pre-October 28, 2025) created a virtual environment but the systemd service didn't use it **Workaround:** 1. Stop Bazarr: `systemctl stop bazarr` 2. Install `uv` package manager: ```bash curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="/root/.local/bin:$PATH" ``` 3. Recreate virtual environment: ```bash cd /opt/bazarr rm -rf venv # if exists uv venv /opt/bazarr/venv --python 3.12 uv pip install -r /opt/bazarr/requirements.txt --python /opt/bazarr/venv/bin/python3 ``` 4. Update service file (`nano /etc/systemd/system/bazarr.service`): Change `ExecStart=/usr/bin/python3` to `ExecStart=/opt/bazarr/venv/bin/python3` 5. Reload and restart: ```bash systemctl daemon-reload systemctl restart bazarr ``` **Related:** - GitHub Issue: https://github.com/community-scripts/ProxmoxVE/issues/7332 - PEP 668: https://peps.python.org/pep-0668/ - Bazarr GitHub: https://github.com/morpheus65535/bazarr
kerem 2026-02-26 12:51:50 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@MickLesk commented on GitHub (Jan 1, 2026):

#555

<!-- gh-comment-id:3703622834 --> @MickLesk commented on GitHub (Jan 1, 2026): #555
Author
Owner

@vidonnus commented on GitHub (Jan 1, 2026):

#555
If you install new scripts or update LXCs using the LXC updater script you will not have this problem.

Debian 12 -> 13 migrations not covered by the mentioned script.

<!-- gh-comment-id:3703633681 --> @vidonnus commented on GitHub (Jan 1, 2026): > [#555](https://github.com/community-scripts/ProxmoxVE/discussions/555) > If you install new scripts or update LXCs using the [LXC updater script](https://community-scripts.github.io/ProxmoxVE/scripts?id=update-lxcs) you will not have this problem. Debian 12 -> 13 migrations not covered by the mentioned script.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#2260
No description provided.