I'm trying to follow instructions here https://docs.mailman3.org/en/latest/install/virtualenv.html on a test server.

When I try to start the newly created mailman3 service it fails
# journalctl -xeu mailman3.service
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/handlers/arc_sign.py", line 22, in <module>
Dec 29 19:42:16 SERVER.de mailman[1469463]:     from authheaders import sign_message
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "/opt/mailman/venv/lib/python3.10/site-packages/authheaders/__init__.py", line 25, in <module>
Dec 29 19:42:16 SERVER.de mailman[1469463]:     from authheaders.dmarc_lookup import dns_query, receiver_record, receiver_record_walk, get_org_domain
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "/opt/mailman/venv/lib/python3.10/site-packages/authheaders/dmarc_lookup.py", line 22, in <module>
Dec 29 19:42:16 SERVER.de mailman[1469463]:     from pkg_resources import resource_filename  # Part of setuptools
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "/opt/mailman/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3267, in <module>
Dec 29 19:42:16 SERVER.de mailman[1469463]:     def _initialize_master_working_set():
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "/opt/mailman/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3241, in _call_aside
Dec 29 19:42:16 SERVER.de mailman[1469463]:     f(*args, **kwargs)
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "/opt/mailman/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3279, in _initialize_master_working_>
Dec 29 19:42:16 SERVER.de mailman[1469463]:     working_set = WorkingSet._build_master()
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "/opt/mailman/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 573, in _build_master
Dec 29 19:42:16 SERVER.de mailman[1469463]:     ws.require(__requires__)
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "/opt/mailman/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 891, in require
Dec 29 19:42:16 SERVER.de mailman[1469463]:     needed = self.resolve(parse_requirements(requirements))
Dec 29 19:42:16 SERVER.de mailman[1469463]:   File "/opt/mailman/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 777, in resolve
Dec 29 19:42:16 SERVER.de mailman[1469463]:     raise DistributionNotFound(req, requirers)
Dec 29 19:42:16 SERVER.de mailman[1469463]: pkg_resources.DistributionNotFound: The 'flufl.lock>=5.1' distribution was not found and is required by mailman
Dec 29 19:42:16 SERVER.de systemd[1]: mailman3.service: Control process exited, code=exited, status=1/FAILURE


The required version of flufl.lock should be installed.

# su mailman
(venv) mailman@server:~$ pip install flufl.lock
Requirement already satisfied: flufl.lock in ./venv/lib/python3.10/site-packages (8.0.2)
Requirement already satisfied: atpublic in ./venv/lib/python3.10/site-packages (from flufl.lock) (4.0)
Requirement already satisfied: psutil in ./venv/lib/python3.10/site-packages (from flufl.lock) (5.9.7)

In another thread regarding a problem with flufl.lock detection it was suggested to remove and reinstall flufl modules.
(venv) mailman@server:~$ pip uninstall flufl.bounce flufl.i18n flufl.lock
(venv) mailman@server:~$ pip install flufl.bounce flufl.i18n flufl.lock
That didn't help either.

In the end I had to edit the file /opt/mailman/venv/lib/python3.10/site-packages/mailman-3.3.9.egg-info/requires.txt and change these lines:
flufl.i18n>=3.2 to flufl-i18n>=3.2
flufl.lock>=5.1 to flufl-lock>=5.1
That workaround was suggested by Thomas Ward here https://gitlab.com/mailman/mailman/-/issues/1085

I'm not very used to python distributions. Are those changes persistent or will they be overwritten with the next update?

Kind regards,
Nils