CentOS 5.3 vs. Python 2.5

Jon Clements joncle at googlemail.com
Wed Nov 25 04:45:08 EST 2009


On Nov 25, 8:13 am, Steven D'Aprano
<ste... at REMOVE.THIS.cybersource.com.au> wrote:
> On Tue, 24 Nov 2009 22:42:28 -0800, John Nagle wrote:
> > My dedicated hosting provider wants to switch me to a new server with
> > CentOS 5.3, so I have to look at how much work is required.
>
> >     CentOS 5.3 apparently still ships with Python 2.4.  Worse, it
> > requires Python 2.4 for its own internal purposes, and actually
> > installing Python 2.5 breaks the package manager.  There's no supported
> > RPM for upgrading.
>
> >     It's apparently necessary to build Python 2.5 from source,
> > build all the packages, and debug.
>
> You shouldn't need *quite* that much effort, particularly if you don't
> care about tkinter. Just use the alternate installation so it doesn't
> stomp all over the 2.4 installation:
>
> .configure
> make
> make altinstall
>
> You will need root or sudo for that last one.
>
> I don't have Centos 5.3, but I have Centos 5, and it seems to work fairly
> easily for me:
>
> $ wgethttp://www.python.org/ftp/python/2.5.4/Python-2.5.4.tgz
> ...
> 18:39:11 (69.6 KB/s) - `Python-2.5.4.tgz' saved [11604497/11604497]
> $
> $ tar xzf Python-2.5.4.tgz
> $ cd Python-2.5.4
> $ ./configure
> ...
> $ make
> ...
> $ sudo make altinstall
> Password:
> ...
> $ python -V
> Python 2.4.3
> $ python2.5 -V
> Python 2.5.4
>
> And it all seems to just work for me.
>
> > Nor does that "just work". There's
> > documentation, but some of it is in Japanese.
>
> >http://blog.bashton.com/2008/python-25-rpms-for-rhel-5-centos-5/
>
> I don't understand why you're using documentation for third-party RPMs as
> evidence that building from source will be troublesome.
>
> --
> Steven

And might I add on a box where there is no root access, but sufficient
tools (compilers etc...)

1) Compile from source
2) Set PYTHONPATH correctly for your shell
3) Set your normal path to include your Python rather than the
system's default Python
4) When installing modules (via setup.py install or easy_install)
include a "home_dir=" (I think that's right OTTOMH) to somewhere in
your home directory, and make sure step 2) complies with this.
5) Double check with "which python" to make sure it's the correct
version.

hth
Jon.






More information about the Python-list mailing list