install python 2.6 on Ubuntu 12.04

Benjamin Kaplan benjamin.kaplan at case.edu
Tue May 22 20:51:44 EDT 2012


On Tue, May 22, 2012 at 8:09 PM, Dan Stromberg <drsalists at gmail.com> wrote:
>
> If the pythons you require are in synaptic (sudo to root and run synaptic),
> you probably can just use them.
>
> If not, then you, for each release, need to:
> 1) download a tarball using a browser or whatever
> 2) extract the tarball: tar xvfp foo.tar.bz2
> 3) cd into the newly created, top-level directory, and run ./configure
> --prefix /usr/local/cpython-2.6 (or similar)
> 4) Run "make", optionally with parallelism; I often use number_of_cores+1,
> so for a quad core system, I might use "make -j 5".  This speeds up the
> build.
> 5) Run /usr/local/cpython-2.6/bin/python - just to make sure it gives a
> prompt.  control-d to exit.
> 6) Try running your script with one of your new python builds:
> /usr/local/cpython-2.6/bin/python my-script
>
> I've done this for 2.5, 2.6, 2.7, 3.0, 3.1, 3.2 and the 3.3 preview stuff.
> They cooperate with each other well.  Actually, I scripted out the build so
> that I'd get all 7 built automatically with cython and pylint in them.
>
>

Even easier:

./configure
make
sudo make altinstall

If I recall correctly, that will install it in
/usr/local/lib/python2.6 and it will create /usr/local/bin/python2.6
but it will not create /usr/local/bin/python so it won't clobber the
system python.



More information about the Python-list mailing list