[Tutor] Installing gnome-python/conflicts with old python versions trouble

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun Jun 1 03:24:02 2003


On 31 May 2003, ashleigh smythe wrote:

Hi Ashleigh,

What's probably happening is that your program "PATH" is placing higher
precedence on the Python 1.52 that's installed on your system, rather than
the local installation of Python 2.2 that you've installed.  What you can
do is modify your PATH environmental varaible so that the directory
'/usr/local/bin' comes in front of the directory '/usr/bin'.


> I have had similar problems installing additional python modules as I'm
> just not clear on where they (or frankly anything else I install!)
> should go - I put biopython into /usr/local/lib/python2.2/site-packages
> but python2.2 can't find my input files in my home directory, only if
> they are also in /site-packages.

Hmmm....  You shouldn't have to move files manually into the
site-packages/ directory.  Python has a system for module installation
called Distutils, and, for the most part, it takes care of path details
for us.  For more details on how this works, we can look at:

    http://www.python.org/doc/current/inst/inst.html


The Cliff Notes version is something like this:  module installation
involves typing the command:

    % /usr/local/bin/python setup.py install

in the directory of the third-party Python module that we want to install.
The absolute path here ensures that we're using the right Python when we
do the install.


'./configure' scripts go outside of the standard Python Distutils system,
so we may have to do something slightly different there.


> checking for python... /usr/bin/python
> checking for python version... 1.5
> checking for python platform... linux-i386
> checking for python script directory...
> ${prefix}/lib/python1.5/site-packages
> checking for python extension module directory...
> ${exec_prefix}/lib/python1.5/site-packages
> checking for python >= 2.2... configure: error: too old

The 'configure' step is finding the old Python 1.52 first, before it has a
chance to see Python 2.2 in the /usr/local/bin/ directory.  I'm not
positive about this, but changing your PATH so that '/usr/local/bin/'
comes up ahead of '/usr/bin/' should do the trick.  You can do this
temporarily with the shell command (in bash):

    $ export PATH="/usr/local/bin:$PATH"
    $ ./configure


But since it sounds like you want to use Python 2.2 all the time, it makes
sense to set your path permanently so that your local programs in
'/usr/local/bin' show up first when the system searches for a binary.


Good luck to you.