If there are several Python versions installed on the system and you want to work with a project that is using some previous version
of Python, then you can use the virtual environment e.g. (new_env) you can upgrade Python just in that venv using:
python -m new_env --upgrade "your virtual environment path"
For example, if we are having Python 3.7 in ./new_env virtual environment and you would like to upgrade venv to Python 3.8, then you can simply execute the below code:
python -m new_env --upgrade ./new_env
If you want to know more about Python, then do refer to the Python course.