Search code examples
pythonfedoraeasy-install

Fedora Python Upgrade broke easy_install


Fedora Core 9 includes Python 2.5.1. I can use YUM to get latest and greatest releases.

To get ready for 2.6 official testing, I wanted to start with 2.5.4. It appears that there's no Fedora 9 YUM package, because 2.5.4 isn't an official part of FC9.

I downloaded 2.5.4, did ./configure; make; make install and wound up with two Pythons. The official 2.5.1 (in /usr/bin) and the new 2.5.4. (in /usr/local/bin).

None of my technology stack is installed in /usr/local/lib/python2.5.

It appears that I have several choices for going forward. Anyone have any preferences?

  • Copy /usr/lib/python2.5/* to /usr/local/lib/python2.5 to replicate my environment. This should work, unless some part of the Python libraries have /usr/bin/python wired in during installation. This is sure simple, but is there a down side?

  • Reinstall everything by running easy_install. Except, easy_install is (currently) hard-wired to /usr/bin/python. So, I'd have to fix easy_install first, then reinstall everything.

    This takes some time, but it gives me a clean, new latest-and-greatest environment. But is there a down-side? [And why does easy_install hard-wire itself?]

  • Relink /usr/bin/python to be /usr/local/bin/python. I'd still have to copy or reinstall the library, so I don't think this does me any good. [It would make easy_install work; but so would editing /usr/bin/easy_install.]

Has anyone copied their library? Is it that simple?

Or should I fix easy_install and simply step through the installation guide and build a new, clean, latest-and-greatest?


Edit

Or, should I

  • Skip trying to resolve the 2.5.1 and 2.5.4 issues and just jump straight to 2.6?

Solution

  • Normally, you would only have one version of a python release installed. Since 2.5.1 and 2.5.4 are from the same release, copying your libraries should work fine. What you would need to watch out for, is that you now have /usr/bin/python, and /usr/local/bin/python in your path, and some utilities may get confused.

    If you need to have both micro-releases installed at once, I would keep 2.5.4 out of your path altogether, or allow it to completely clobber the other (do so at your own risk though ;) If you go with the former, you can also point 2.5.4 to your site-packages by using the PYTHONPATH environment variable.

    Ubuntu takes a different route, and this is how you can handle different major releases. The python binary is given with the version appended:

    /usr/bin/python -> python2.6
    /usr/bin/python2.5
    /usr/bin/python2.6
    

    Each has their own /usr/lib/python2.X directory with versions of all the modules.

    And lastly, you can further customize your setup by modifying your site.py