Run it exactly as you would on the shell, i.e., as sh ./setup.sh
:
subprocess.call('sh ./setup.sh', shell=True)
That should do the trick. Most likely, your setup.sh
is not set to executable or is missing the first #!
line that marks its interpreter.
EDIT:
Make sure to set shell=True
to execute it via the shell, if you pass it as a single string, or separate the parameters into a list, as you might with execve
:
subprocess.call(['sh', './setup.sh'])