Warm tip: This article is reproduced from serverfault.com, please click

How to update python 3.8 to python 3.9 keeping all the packages?

发布于 2021-01-14 07:13:25

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?

Questioner
Zubayer
Viewed
0
1,026 2021-01-14 16:12:16
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
    call("pip install --upgrade " + dist.project_name, shell=True)