venv and upgrade from python 3.11 to 3.13 because of OS-upgrade
Hi,
I have a venv installation (mailman postorius django-mailman3 hyperkitty mailman-web) with python 3.11 from the Linux distribution. Since distribution EOL nears, I checked python version in next distribution and it is python 3.13.
So my guess is, after distro upgrade, this will stop working.
How should I upgrade?
-- Mit freundlichen Gruessen, Andreas Vetter
Andreas Vetter writes:
I have a venv installation (mailman postorius django-mailman3 hyperkitty mailman-web) with python 3.11 from the Linux distribution. Since distribution EOL nears, I checked python version in next distribution and it is python 3.13.
So my guess is, after distro upgrade, this will stop working.
How should I upgrade?
I haven't done this, so take it with a grain of salt.
Stop mailman and mailman-web.
Upgrade the OS.
Check that the RDBMS is still available, using the command line utility. In Debian I seem to recall that PostgreSQL tries to automatically upgrade the database to the new version, you may not need to do anything further.
- If not you may need to deal with the database upgrade if it is a major version upgrade.
Check that the old venv is in fact broken (I think there's usually versioned symlinks rather than an actual copy of the python install, so it "should" break). If it's not, you're done.
You may be able to use "--upgrade": /usr/bin/python3.13 -m venv --upgrade However I seem to recall that --upgrade doesn't work across major upgrades. If it does work, you're done.
If that fails, create a new venv in the same directory that holds the existing venv. (I typically name my venvs like ".v3.13".) python -m venv --upgrade-deps # ensure most recent pip etc
- Reinstall mailman etc there:
python -m pip install mailman mailman-web # or your list may be better
- Update paths in external configuration to point to new venv: systemd (maybe /usr/local/lib/systemd/system/mailman*) cron (probably /etc/cron.d/mailman*)
- Alternatively, you can delete the old venv and replace it with a symlink to the new one. I don't think you can rename the new venv to the old one's name because I think there are absolute paths in the venv's internal configuration, but you could try, and switch back to the symlink method if it doesn't work.
I suppose you will get upgrades of a number of packages. Django or one of its dependencies may start issuing warnings about deprecated settings for authentication, and you may have issues with a missing nntp module (it was deprecated several versions ago and finally removed from Python 3.13, the fix is to install the nntp module from PyPI (it has "standard" or "stdlib" in the name). Both of these issues have been discussed recently on this list.
Note that I *have* used alternate Python installs via the symlink method and switched back and forth.
Hope this helps. Maybe there's a better way, but that's how I would handle it.
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
On 3/12/26 07:05, Stephen J. Turnbull wrote:
Andreas Vetter writes:
How should I upgrade?
I haven't done this, so take it with a grain of salt.
<instructions snipped>
Steve's suggestion is good, however there are a couple of incompatibility issues between the currently released version of Mailman core and Python 3.13 and also between mailman-web and django-allauth. For this reason you should upgrade these in your venv from GitLab.
pip install git+https://gitlab.com/mailman/mailman@master
pip install git+https://gitlab.com/mailman/mailman-web@master
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Donnerstag, 12. März 2026 18:10:13 Mitteleuropäische Normalzeit Mark Sapiro wrote:
On 3/12/26 07:05, Stephen J. Turnbull wrote:
Andreas Vetter writes:
How should I upgrade?
I haven't done this, so take it with a grain of salt.
<instructions snipped>
Steve's suggestion is good, however there are a couple of incompatibility issues between the currently released version of Mailman core and Python 3.13 and also between mailman-web and django-allauth. For this reason you should upgrade these in your venv from GitLab.
pip install git+https://gitlab.com/mailman/mailman@master
pip install git+https://gitlab.com/mailman/mailman-web@master
Thank you Steve and Mark for your help. One more question. When next version of mailman and mailman-web is released. How would I switch back from git to "normal".
Again, thank you very much. Also for all the time you put in here to help people.
-- Mit freundlichen Gruessen, Andreas Vetter
On Fri, Mar 13, 2026, at 4:45 AM, Andreas Vetter wrote:
On Donnerstag, 12. März 2026 18:10:13 Mitteleuropäische Normalzeit Mark Sapiro Thank you Steve and Mark for your help. One more question. When next version of mailman and mailman-web is released. How would I switch back from git to "normal".
Once you go git, you can never go …. bit. :-)
I think just pip install -U mailman mailman-web would do it.
-- Paul Tomblin
On 3/13/26 08:39, Paul Tomblin via Mailman-users wrote:
Thank you Steve and Mark for your help. One more question. When next version of mailman and mailman-web is released. How would I switch back from git to "normal".
Once you go git, you can never go …. bit. :-)
coffee -> keyboard
-- Dave McGuire, AK4HZ New Kensington, PA
participants (5)
-
Andreas Vetter -
Dave McGuire -
Mark Sapiro -
Paul Tomblin -
Stephen J. Turnbull