Installing Python on CentOS 6 - a big pain

rusi rustompmody at gmail.com
Fri Jan 20 12:32:25 EST 2012


On Jan 20, 2:39 pm, Benedict Verheyen <benedict.verhe... at gmail.com>
wrote:
> On 19/01/2012 5:36, Steven D'Aprano wrote:
>
>
>
>
>
>
>
> > On Wed, 18 Jan 2012 19:10:43 -0800, alex23 wrote:
>
> <snip>
>
> > download the tar ball
> > extract the contents of the file
> > cd into the source directory
> > run ./configure
> > run make
> > optionally run make test
> > run sudo make altinstall
>
> > As a total n00b who'd never used make before, it took me 25 minutes
> > effort on my first attempt, including reading the entire README file
> > (twice!). Now I have the whole process down to about 30 seconds effort,
> > and six minutes elapsed time, on my laptop.
>
> <snip>
>
> My first attempt to compile it on Debian took some extra steps,
> as Python didn't find the ncurses and and readline libs.
> But it was still easy to figure out how to build and install (locally) all
> the necessary packages.
> I leave the system installed python alone, and install the python version
> I built in $HOME/usr/local so I can later use this in a virtualenv.
>
> These are part of my notes from a while back so version might not be
> up to date anymore.
>
> 1. Compile zlib
> tar xzvf zlib-1.2.5.tar.gz
> cd zlib-1.2.5
> ./configure --64 --prefix=$HOME/usr/local
> make
> make install
>
> 2. Compile readline
> tar xzvf readline-6.1.tar.gz
> ./configure --enable-shared --prefix=$HOME/usr/local
> make
> make install

>
> 3. Compile ncurses
> tar xzvf  ncurses-5.7
> ./configure --with-shared --enable-termcap --prefix=$HOME/usr/local
> make
> make install

If you apt-get the foll
libncurses5-dev
libreadline6-dev
zlib1g-dev

the first three steps should not be necessary.

In general
apt-get build-dep python2.7
will list out (a superset of) what python2.7 needs.


>
> 4. Install Python from source
> tar xzvf Python-2.7.2.gz
> cd Python-2.7.2
> export LDFLAGS="-L$HOME/usr/local"
> ./configure --enable-shared --prefix=$HOME/usr/local
> make
> make install
>
> If i need to install a new version of Python, as I happen to have done today,
> I only need to do step 4. Which is maybe 5 minutes of work.
>
> Cheers,
> Benedict




More information about the Python-list mailing list