Mostly Linux & Python syntax notes and hyperlinks.

Thursday, March 18, 2010

Linux: We've got python2.4, we need python2.6 now, too.

pointers to YUM or RPM
If we had YUM, it would be easy:
yum upgrade python
yum install tkinter

RPM sounds scary.

And we also need to be able to still run python2.4 for some projects.

From  http://python.org/download/
Click on Python 2.6.4 compressed source tarball (for Linux, Unix or OS X)

Copy Python-2.6.4.tgz to where you want it.

tar xvzv  Python-2.6.4.tgz

produces a Python-2.6.4/ directory.

Here's the README.  My only question is what is the top-level directory to which they refer.  Is it where I want the final python2.6.4 lib to be?

...To start building right away (on UNIX): type "./configure" in the
current directory and when it finishes, type "make".  This creates an
executable "./python"; to install in /usr/local, first do "su root"
and then "make install".
then
Build instructions
==================
Before you can build Python, you must first configure it.
Fortunately, the configuration and build process has been automated
for Unix and Linux installations, so all you usually have to do is
type a few commands and sit back.  There are some platforms where
things are not quite as smooth; see the platform specific notes below.
...
Start by running the script "./configure", which determines your
system configuration and creates the Makefile.  (It takes a minute or
two -- please be patient!)  You may want to pass options to the
configure script -- see the section below on configuration options and
variables.  When it's done, you are ready to run make.

To build Python, you normally type "make" in the toplevel directory.
If you have changed the configuration, the Makefile may have to be
rebuilt.  In this case you may have to run make again to correctly
build your desired target.  The interpreter executable is built in the
top level directory.

Once you have built a Python interpreter, see the subsections below on
testing and installation.  If you run into trouble, see the next
section.
...

Ah, phew. I don't have to do this. We have a tar file on our company intranet with the approved 2.6 python libs already tarred up for the taking. If only it had been easier to find an hour ago when I looked... Worth finally asking the humans though. No matter how harried they look.

I leave this post anyway, in case someone reading this actually does have to install python.

1 comment:

  1. In linux the procedure:

    ./configure
    make
    sudo make install

    is known as "the mantra" 8)

    ReplyDelete

Blog Archive