Cannot install any package due to errors processing python packages after installing python 3.9

Solution 1:

Don't link Python3 to a different version of Python.

python3 MUST link to the system-provided version of Python in order for your system to work properly. For example, apt depends upon that specific version; you broke apt when you changed the link.

To use a different version of Python, keep it in a container or venv. You can link whatever you like inside the container/venv.

Revert your change. You changed the link once; simply change it back.