subprocess check_output

Chris Angelico rosuav at gmail.com
Wed Dec 30 17:32:48 EST 2015


On Thu, Dec 31, 2015 at 8:02 AM, Cameron Simpson <cs at zip.com.au> wrote:
> On 30Dec2015 21:14, Carlos Barera <carlos.barera at gmail.com> wrote:
>>
>> Trying to run a specific command (ibstat)  installed in /usr/sbin on an
>> Ubuntu 15.04 machine, using subprocess.check_output and getting "/bin/sh:
>> /usr/sbin/ibstat: No such file or directory"
>>
>> I tried the following:
>> - running the command providing full path
>> - running with executable=bash
>> - running with (['/bin/bash', '-c' , "/usr/sbin/ibstat"])
>>
>> Nothing worked ...
>
>
> The first check is to run the command from a shell. Does it work? Does
> "which ibstat" confirm that the command exist at that path? Is it even
> installed?

And do those checks as the same user as your script runs as, with the
same environment and all. You might find that a file is executable for
one user but not for another, or something.

ChrisA



More information about the Python-list mailing list