sh: test: argument expected

I

Iván Cabria

Hi,

I have run the script using "python scriptname.py" and the error does
not go away. I got the same error:

sh: test: argument expected


I have checked again that the first line of the python script is
#!/usr/bin/env python

There are no blank lines or empty spaces before
#!/usr/bin/env python


I also did "grep loginname /etc/passwd" to confirm I was using bash, and the
line I got ended with

:/usr/bin/bash




Iván
 
S

Steve Holden

Iván Cabria said:
Hi,

I have run the script using "python scriptname.py" and the error does
not go away. I got the same error:

sh: test: argument expected


I have checked again that the first line of the python script is
#!/usr/bin/env python

There are no blank lines or empty spaces before
#!/usr/bin/env python


I also did "grep loginname /etc/passwd" to confirm I was using bash, and the
line I got ended with

:/usr/bin/bash

That's as may be, but I can't escape the conclusion that your script is
involving the shell somehow - maybe the GetPotentialEnergy() method
calls os.system() or some other piece of functionality.

About all I can say is that the error message you are seeing is
definitely NOT from the Python interpreter. Try putting a print
statement of some kinf as the second loine of your script and make sure
that Python is actually running that script. If it is, you'll need to
find out where it's calling shell functionality.

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top