Sonarr version (exact version): 3.0.10.1567
Mono version (if Sonarr is not running on Windows): 6.12.0.182
OS: Debian 12
Debug logs: None
Description of issue:
I’ve just moved to a new server that has Debian 12 on it.
With Debian 12, Python now requires modules to be installed and run from virtual environments.
You can’t just pip install globally or at the user level anymore. You have to create a virtual environment, source/activate it and then you can install your modules. Your scripts need to be run via the venv though.
That is causing me trouble because Sonarr doesn’t run via any Python venv and I’m not sure how to do it.
To run any Python script on Debian 12:
- Create a venv:
python3 -m venv ~/my-sonarr-venv
- Active the venv:
source ~/my-sonarr-venv/bin/activate
- Install your modules:
python3 -m pip install requests python-dotenv etc...
- Run your script:
python3 your_scripts.py
A bit of a pain not to say the least, but it’s part of PEP 668.
That’s how I understand the new system works.
Anybody in the same boat or have any insight on how to run custom python scripts with a virtual environment enabled?
Or maybe there’s a way to have Python behave the old fashion way and not requiring a venv?