How to install python packages from older version to newer version?

落花浮王杯 提交于 2021-02-17 02:06:30

问题


i was working with python 3.7 and i installed recently python 3.8 in linux.

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.

i want to avoid to do it by hand every package.

Note: i install them in my system not using venv.

Thanks!


回答1:


/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



回答2:


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

pip freeze > requirements.pip in the old version

pip install -r requirements.pip in the new version



来源:https://stackoverflow.com/questions/58473864/how-to-install-python-packages-from-older-version-to-newer-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!