A weewx venv installation is not consistent in where it pins things to a specific python version vs. where it relies on the os default python version (perhaps a bug). Long answer follows, but there might be a quick fix...
Background:
- bookworm uses python3.11 so your original venv expected python3.11 for everything under the hood, as well as its systemd service files
- Unfortunately bookworm => trixie changes your system python version from 3.11 to 3.13
- so you've created a mismatch between the os python (new) and the weewx configuration that still expects the older 3.11 version of python
- and weewx being inconsistent in where it relies on the os python version is what you are likely running into
Looking in weewx-venv/bin:
lrwxrwxrwx 1 root root 7 Sep 1 17:14 python -> python3
lrwxrwxrwx 1 root root 16 Sep 1 17:14 python3 -> /usr/bin/python3
lrwxrwxrwx 1 root root 7 Sep 1 17:14 python3.11 -> python3
But the /etc/systemd/system weewx service files (there are three) contain:
ExecStart=/home/pi/weewx-venv/bin/python3 \
/home/pi/weewx-venv/lib/python3.11/site-packages/weewxd.py \
/home/pi/weewx-data/weewx.conf
So when you walk the symlinks the ExecStart is using the 'os' python version not the 'venv' python version. That (to me) is a bug.
- weewx-venv/bin/python3 points to /usr/bin/python3 (the os version)
- when it should point to /usr/bin/python3.11 (the specific version the venv was created under)
A quick fix is to change one symlink to make things consistently point to the original 3.11 python still present (but not the default) of your os:
- deactivate the venv
- remove the weewx-bin/python3 symlink
- add a new symlink pointing it to /usr/bin/python3.11
- activate the venv
- run "python3 --version" and you'll see it points to the original 3.11
- so everything will be consistently pointing to the original 3.11 version
I'm thinking this might be a weewx bug - the symlink in the venv should point to the specific python version the venv was created in, once you read through all the symlinks. If apps are going to set up a venv to be immune from the os default python version changing, they need to do so consistently to effectively pin themselves end-to-end to a specific version of python.