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

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top