I broke Yum (by messing with Python libs)

Cameron Simpson cs at zip.com.au
Mon Mar 23 04:39:23 UTC 2015


On 22Mar2015 17:10, Martin Cigorraga <martincigorraga at gmail.com> wrote:
>After upgrading some python packages via pip I found I left Yum in a
>non-working state: [...]

I have found it is quite important to completely separate "supplier" package 
updates (i.e. yum supplied) and user driven package updates and/or additions 
(i.e. pip). This holds with Perl, Python, etc.

In the case of python I strongly advocate making a virtualenv (easier than 
you'd think) and run pip within that. This has the advantage of:

  - keeping extra packages completely away from the system packages

  - lets you use multiple versions of Python as needed (the system Python, other Pythons installed in /usr/local or /opt etc)

  - with the right permissions, lets you create and maintain the virtualenv area as yourself; I keep a current python2 and python3 virtualenv in my homedir routinely

Do not touch the system packages!!!

[...]
>Now, what I did to fix the mess was:
>1. Download python-pycurl-7.19.3.1-5.fc21.x86_64.rpm;
>2. rpm --nodeps -e python-curl
>3. rpm -ivh python-pycurl-7.19.3.1-5.fc21.x86_64.rpm.
>
>So far so good, Yum isn't complaining anymore about the library version
>mismatch; however I would like to know if I proceeded right or if there's
>still any missing step(s) I should follow to ensure a proper system
>integrity.

Just this: let yum maintain the system python packages and use a virtualenv for 
your extras. NB: you can set up the virtualenv to live off the system python 
(or whichever) as a basis, which means that anything you _do_ install with yum 
is then available for free in the virtualenv. Or you can make it standalone and 
use the virtualenv pip for aal its extras.

Cheers,
Cameron Simpson <cs at zip.com.au>


More information about the users mailing list