What is the correct way to upgrade Python packages when upgrading Python from 2.6 to 2.7?

I installed A LOT of python packages for Python 2.6. Now I would like to upgrade Python to version 2.7. Is there a correct or systematic way to update all installed packages?

On my system, all packages are installed on / usr / lib 64 / python2.6 / site-packages / and / usr / lib / python 2.6 / site-packages /

One obvious way is to install Python 2.7, download all package sources or egg files and reinstall them one by one. However, some useful packages, such as numpy and scipy, are notorious for installation, especially when you need to install from the source. I expect that I will need to spend several hours to find packages and solve installation problems here and there.

Anyone have suggestions for systematically updating installed packages?

+6
source share
1 answer

First, you should never ever ever install Python packages in the system library folder using easy_install using sudo on any operating system.

http://jamiecurle.co.uk/blog/installing-pip-virtualenv-and-virtualenvwrapper-on-os-x/#comment-573429347

The correct procedure will make your installation procedure repeatable. There are two commonly used solutions in the Python world. These solutions automatically download the correct versions of Python packages from http://pypi.python.org

Pip

pip and requirements.txt http://www.pip-installer.org/en/latest/requirements.html at virtualenv http://pypi.python.org/pypi/virtualenv

Buidout

Line example from Plone CMS https://github.com/plone/Installers-UnifiedInstaller/blob/master/base_skeleton/versions.cfg

Buildout can also customize, create, install style settings for packages that need their own libraries. For example, there is a solution for libxml2 + lxml

http://pypi.python.org/pypi/z3c.recipe.staticlxml/

(Note: buildout does not need virtualenv as it makes its own isolation from system Python)

+4
source

Source: https://habr.com/ru/post/921321/


All Articles