Since python 3.6 is no longer supported in Ubuntu 21.10 and the usual deadsnakes method also doesnt work. It gives following error.
E: The repository 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu impish Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.