473,322 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Bad interpreter

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 ??

Thanx

Jul 18 '05 #1
10 2855
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...

-Peter
Jul 18 '05 #2
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...

-Peter


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 :/

--
Damien
Jul 18 '05 #3
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
Jul 18 '05 #4
Le Wed, 26 May 2004 07:51:42 -0400, Peter Hansen a écrit*:
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


/usr/bin/python2.3 exists, it starts perfectly, when i use
a alias mysoft="/usr/bin/python2.3 /path/to/my_script"
it works perfectly too ...

i got a small script ... it's work perfectly too ...
with the chmod +x and the ./script ...

I'm lost, i've no idea :)

--
Damien
++
I've lost my mind ...
But it's on a backup tape ...
... somewhere ...
Jul 18 '05 #5
Hi!

Am Wed, 26 May 2004 13:21:28 +0200 schrieb BaBS:
Thanks for the tips but ... i don't have CR Character ...


Are you sure? Aren't there "^M"s at the line ends, when you
type 'cat -v myscript.py'?

Jan
Jul 18 '05 #6
Peter Hansen wrote:
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...

Should be the other way 'round: If you edit the file under Windows (e.g.
with Notepad), (invisible) CRs are added. Use a windows editor that
supports "Unix" lineendings (e.g. UltraEdit: File->Conversions->DOS to
UNIX).
One way to fix this on a Linux/UNIX system would be:
tr -d '[\r]' <script.py >fixed_script.py
Jul 18 '05 #7
Benjamin Niemann wrote:
Peter Hansen wrote:
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...
Should be the other way 'round: If you edit the file under Windows (e.g.
with Notepad), (invisible) CRs are added.


We're saying the same thing. You call them invisible, I call
them hidden, and we're both saying they got added when he
edited the file under Windows. If he were to open the file in, say,
"vi" instead, on Linux, it would display the ^M endings, no doubt,
at least if he entered ":set list" to display invisible characters.
One way to fix this on a Linux/UNIX system would be:
tr -d '[\r]' <script.py >fixed_script.py


Good idea.

-Peter
Jul 18 '05 #8
Peter Hansen wrote:
Benjamin Niemann wrote:
Peter Hansen wrote:
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...


Should be the other way 'round: If you edit the file under Windows
(e.g. with Notepad), (invisible) CRs are added.


We're saying the same thing.


Ah, I see you understood me to be saying that "by moving the
file to a Windows system you can remove the CR characters".

My intended meaning was "you got the CR characters
by moving the file to a Windows system", and I wasn't giving
him any idea how to remove them. :-)

Confusion solved...

-Peter
Jul 18 '05 #9
Le Wed, 26 May 2004 14:57:09 +0200, Benjamin Niemann a écrit*:
Peter Hansen wrote:
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...

Should be the other way 'round: If you edit the file under Windows (e.g.
with Notepad), (invisible) CRs are added. Use a windows editor that
supports "Unix" lineendings (e.g. UltraEdit: File->Conversions->DOS to
UNIX).
One way to fix this on a Linux/UNIX system would be:
tr -d '[\r]' <script.py >fixed_script.py

Oké thanx, I probably forget something when i edit it under
EditPlus [which handle the CR] but usualy, emacs show me the ^M :/
Anyway ... i don't use windows anymore :)
Thanx a lot everybody ...

--
Damien
++
I've lost my mind ...
But it's on a backup tape ...
... Somewhere ...
Jul 18 '05 #10
Le Wed, 26 May 2004 09:49:09 -0400, Peter Hansen a écrit*:
Peter Hansen wrote:
Benjamin Niemann wrote:
Peter Hansen wrote:

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...

Should be the other way 'round: If you edit the file under Windows
(e.g. with Notepad), (invisible) CRs are added.


We're saying the same thing.


Ah, I see you understood me to be saying that "by moving the
file to a Windows system you can remove the CR characters".

My intended meaning was "you got the CR characters
by moving the file to a Windows system", and I wasn't giving
him any idea how to remove them. :-)

Confusion solved...

-Peter

1000 times sory, misunderstand :)
I read too fast :)

Thanx anyway :)

--
Damien
++
I've lost my mind ...
But it's on a backup tape ...
... somewhere ...
Jul 18 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Neil Benn | last post by:
Hello, I'm looking at a small app which would need a very quick startup time for the Python interpreter. It doesn't do much (copying and caching of files, no GUI) but I need the Python...
12
by: Anon | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all I am a beginner teaching myself python, and I am enjoying it immensely :) As a language it is great, I real treat to study, I actually...
1
by: Donnie Leen | last post by:
I wrote a program embbed boost.python, each thread running a sub-interpreter, i made a module implement by boost.python, and i wish this module imported in each sub-interpreter, i find that the...
12
by: Rex Eastbourne | last post by:
Hi, I'm interested in running a Python interpreter in Emacs. I have Python extensions for Emacs, and my python menu lists "C-c !" as the command to run the interpreter. Yet when I run it I get...
4
by: Ian Giblin | last post by:
I am an experienced C programmer, learning C++ by writinging a mathematical toolkit in the framework of a script interpreter. I am posting here to ask for advice (or references) on the object...
12
by: ozbear | last post by:
If one were writing a C interpreter, is there anything in the standard standard that requires the sizeof operator to yield the same value for two different variables of the same type? Let's...
6
by: gr | last post by:
hi.. I must implement an interpreter in C programming language that will get the source code of a program in text file format and execute it. but i don't know C language enough to write this...
3
by: Robin Becker | last post by:
As part of some django usage I need to get some ReportLab C extensions into a state where they can be safely used with mod_python. Unfortunately we have C code that seems incompatible with...
40
by: castironpi | last post by:
I'm curious about some of the details of the internals of the Python interpreter: I understand C from a hardware perspective. x= y+ 1; Move value from place y into a register Add 1 to the...
5
by: Erik Hahn | last post by:
I'm looking for a standalone Javascript interpreter like the ones of Perl and Python. Does such a thing exist for Linux? Thanks in advance. -Erik --...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.