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

其他-如何将python 3.8更新到python 3.9保留所有包?

(其他 - How to update python 3.8 to python 3.9 keeping all the packages?)

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

我是 python 3.8 用户。所以,为了保持更新,我想将我的 python 3.8 更新到 3.9。但是我在 python 3.8 中安装了大量软件包。有什么方法可以保留包并将python 3.8更新到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)