/usr/bin/env: python: No such file or directory

Chris Barker chrishbarker at attbi.com
Thu Dec 20 16:13:44 EST 2001


Cliff Wells wrote:
> On Thu, 20 Dec 2001 10:16:54 -0800
> Chris Barker <chrishbarker at attbi.com> wrote:
> 
> > I suppose, if we all, as a community, start using:
> >
> > #!/use/bin/env python2.1
> >
> > Then the problem will be solved, at least on *nix...
> >
> > Then what do you do with a script that will run on either 1.5 or 2.0 or
> > 2.1 ????? and you don't know which of these might be installed?

> It seems reasonable that if your script requires a particular version of Python to append the version to the executable name (i.e. python2.1),

There are two problems here: 

1) This would only work if we all, as a community, established this
convention. So far I have only seem "python" used, for all versions...

2) It only applies to *nix. Windows and the Macintosh would need
different conventions. I think a platform independent Python based
solution is a better way to go.

>> and if your script doesn't care, then just use "python" which could be a symbolic link to the >> default python interpreter (much as redhat has it 
>> now).

The problem with what RedHat has now is that apparently some of the
scripts DO care! even though now it is not too hard to write code that
will run on version 1.5 - 2.2, eventually we will be at Python 4.*, and
you may be very hard pressed to write code that doesn't care, but you
may be able to write code that works on 2.2 - 3,5 , for instance. Also
while you may write a script now that "doesn't care", when Python 3
comes out with some new incompatability, it will then care, but the
"python" will still be there.

>>  It might be helpful if the python interpreter took a flag such as
>>  --required-version or >> --minimum-version so that a warning could
>> be printed if the script requires a version different than what is
>> available on the system.

How would the interpreter know what version was required? That's exactly
what I think we need...A way to tell the interpreter what version is
required by a script.

-Chris



-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at attbi.net                ---           ---           ---
                                     ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------



More information about the Python-list mailing list