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

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


Hamish Lawson wrote:

> Though perhaps not the case here, I'll just mention a problem that is
> worth being aware of when transferring a script from a Windows/DOS
> system to Unix. If the difference in line-ending conventions hasn't
> been taken care of (such as by using ASCII mode during FTP transfer),
> then the spurious ^M in the script's #! line can trip up the shell or
> the env command, since it will be trying to run the program python^M.

This is a "moving stuff from Windows to *nix" issue, and has NOTHING to
do with Python in particular. As stated, it is the shell (is it the
shell? or is it something lower in the system...I have no idea) that is
examining that first #! line, so we havn't gotten anywhere near Python
yet.

We really do need to find a Python solution to distinguishing different
Python versions, however. Python has now gotten mature enough, and
established enough that there are a lot of programs out there that work
just fine with a current version, and users should not have to do
anything to keep them working...It should be hard to break an existing
settup when you upgrade Python, not hard to preserve it!

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?

-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