I am a python 3.8 user. So, to stay updated I want to update my python 3.8 to 3.9. But I have a huge number of packages installed in python 3.8. Is there any method to keep the packages and update python 3.8 to 3.9?
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)
please format your answer for readability purposes.