Wrong Executable? or something

Clarence Gardner clarence at beach.silcom.com
Mon Dec 20 14:11:14 EST 1999


This is a problem I've seen on many linux systems.  They're all RedHat or
Mandrake (extended RedHat).

The python executable in /usr/bin seems to affect scripts that are supposed
to be run by other executables.  Here's what I mean:

First, let's see each python:
    [clarence at serials2 clarence]$ /usr/bin/python
    Python 1.5.1 (#1, Mar 21 1999, 22:49:36)  ...
    Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
    >>> 
    [clarence at serials2 clarence]$ /usr/local/bin/python
    Python 1.5.2 (#14, Dec 20 1999, 10:21:32)  ...
    Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
    >>> 

Now here is a little script that explicitly wants to be run by the
python in /usr/local/bin:
    [clarence at serials2 clarence]$ cat pyver
    #!/usr/local/bin/python
    import sys
    print sys.version
If I run /usr/local/bin/python and tell it to run this script, all is fine:
    [clarence at serials2 clarence]$ /usr/local/bin/python ./pyver
    1.5.2 (#14, Dec 20 1999, 10:21:32)  ...
But if I just run the script, something weird happens (I don't really
know what):
    [clarence at serials2 clarence]$ ./pyver
    Built-in exception class not found: EnvironmentError.  Library mismatch?
    Warning!  Falling back to string-based exceptions
    1.5.2 (#14, Dec 20 1999, 10:21:32)  ...
However, if remove the python in /usr/bin:
    [clarence at serials2 clarence]$ su
    Password: 
    [root at serials2 clarence]# cd /usr/bin
    [root at serials2 bin]# mv python Python
    [root at serials2 bin]# exit
Then it runs as expected:
    [clarence at serials2 clarence]$ ./pyver
    1.5.2 (#14, Dec 20 1999, 10:21:32)  ...


I am one confused puppy :(  Does anyone have a clue what's going on here?
I would think it must be a Linux thing, but I'm crossposting to
comp.lang.python just in case.

-=-=-=-=-=-=-=-=
Clarence Gardner
Software Engineer
NetLojix Communications, Inc.    NASDAQ:NETX
clarence at netlojix.com



More information about the Python-list mailing list