简体   繁体   English

如何将 python 软件包从旧版本安装到新版本?

[英]How to install python packages from older version to newer version?

i was working with python 3.7 and i installed recently python 3.8 in linux.我正在使用 python 3.7,我最近在 linux 中安装了 python 3.8。

Is there any bash command or script that take a list of all packages of 3.7 and install it one by one in 3.8 version.是否有任何 bash 命令或脚本获取 3.7 的所有包的列表并在 3.8 版本中一一安装。

i want to avoid to do it by hand every package.我想避免每个 package 都手动操作。

Note: i install them in my system not using venv.注意:我将它们安装在我的系统中,而不使用 venv。

Thanks!谢谢!

/path_to_3.7_bin/python -m pip freeze > /home/packages_list.txt

then然后

/path_to_3.8_bin/python -m pip install -r /home/packages_list.txt

try https://pip.pypa.io/en/stable/reference/pip_freeze/试试https://pip.pypa.io/en/stable/reference/pip_freeze/

pip freeze > requirements.pip in the old version pip 冻结>要求。旧版本中的pip

pip install -r requirements.pip in the new version pip install -r requirements.pip 在新版本中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM