Is it mandatory to have the python version 3.8 for this Open edX project?

Python versions prior to 3.7 have already stopped getting security announcement or patches, so Open edX switched to version 3.8 in the Koa release which came out in late 2020. Testing and/or supporting additional Python versions for each Open edX release would require an unreasonable burden of development time and continuous integration testing resources. If you still want to use Python 3.5 you’d need to go back to the Juniper release of Open edX, for 2.7 you’d need Ironwood or earlier. But running any releases that old has a good chance of leaving you exposed to an assortment of security vulnerabilities that have been fixed in newer versions of all the code involved (Open edX, its dependencies, and Python itself).

The next version of Python likely to be supported by Open edX is 3.10, since that is present by default in Ubuntu 22.04 LTS. But while the code changes needed to support that are expected to be minimal, not much testing towards it has been started yet (other upgrade efforts have been more pressing).