Bad interpreter

Peter Hansen peter at engcorp.com
Wed May 26 07:51:42 EDT 2004


BaBS wrote:

> Le Wed, 26 May 2004 07:08:50 -0400, Peter Hansen a écrit :
>>BaBS wrote:
>>>I've a problem whith my python script,
>>> i chmod'ed it to +x, addes the line :
>>>#!/usr/bin/python2.3
>>>and i verified that /usr/bin/python2.3 exists
>>>but i've something like 
>>>: bad interpreter: No such file or dir ...
>>>
>>>What's the matter ??
>>
>>Remove the hidden CR character which you got at the end of the
>>lines by moving the file to a Windows system and editing it. ;-)
>>
>>This one is pretty tricky to figure out the first few times...
> 
> Thanks for the tips but ... i don't have CR Character ...
> i edit my file with notepad and editplus but no matter what
> It's the same message :/

It's either that or /usr/bin/python2.3 doesn't really exist.
If you type "/usr/bin/python2.3" at the prompt, does the
interpreter come up properly?  If it does, try creating a
new file without using an editor.  Type the commands below
at the Linux $ prompt:

$ cat >test.py
#!/usr/bin/python2.2
print 'works'
(hit Ctrl-D here to close the file)
$ chmod +x test.py
$ ./test.py
works

If you don't get the final output, but still get the "bad
interpreter" thing, yet if the interpreter works properly
when you execute it directly, then I have no idea and will
be quite interested to learn the final solution.

-Peter



More information about the Python-list mailing list