privacyIDEA stops working after upgrading Ubuntu 18.04 to 20.04

Apache’s error log says:

Python path configuration:
PYTHONHOME = ‘/opt/privacyidea’
PYTHONPATH = (not set)
program name = ‘python3’
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = ‘/usr/bin/python3’
sys.base_prefix = ‘/opt/privacyidea’
sys.base_exec_prefix = ‘/opt/privacyidea’
sys.executable = ‘/usr/bin/python3’
sys.prefix = ‘/opt/privacyidea’
sys.exec_prefix = ‘/opt/privacyidea’
sys.path = [
‘/opt/privacyidea/lib/python38.zip’,
‘/opt/privacyidea/lib/python3.8’,
‘/opt/privacyidea/lib/python3.8/lib-dynload’,
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named ‘encodings’

Well, after some sym-linking python3.6 > python3.8 Apache starts with no errors. But opening privacyIDEA causes a 500 Internal server error:

mod_wsgi (pid=13293): Exception occurred processing WSGI script ‘/etc/privacyidea/privacyideaapp.wsgi’.

ModuleNotFoundError: No module named ‘_cffi_backend’