After writing a very simple python script to ls
the contents of my project directory as a test:
from subprocess import *
p = Popen(['ls /Users/Nelson/Projects'], stdout=PIPE, shell=True)
print(p.communicate()[0].decode())
It kicked out the error:
/bin/bash: ls: command not found
I did a bit of testing and discovered the basic commands pwd
, echo
, and cd
all word perfectly fine, but not ls
. I tried using the option executable='/bin/bash'
because it is defaulting to /bin/sh
, but that did nothing.
This script has been tested on Ubuntu 14.04 LTS and Ubuntu 16.04 LTS, both work fine.
I am using Mac OSX 10.12.3 Sierra if that means anything in this situation
Any responses are greatly appreciated!