Disclaimer: I'm extremely new at Python programming so I could be doing things very wrong here
All I want to do is run a git command from an open file. Here is the call that I am making
subprocess.Popen( 'git status', cwd = os.path.dirname( path ), shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE )
and the error message I am receiving is this: /bin/sh: git: command not found
I have verified that it is pointing to the correct directory by doing a list of the files. Also if I open a file that is under subversion control and do an svn info command everything works perfectly. I'm at a total loss as to what I'm missing here.
1 Answer 1
As Amber said, do a 'which git' in a shell, it'll tell you where git is installed. Then call git with the full path, eq with /usr/bin/git :
subprocess.Popen( '/usr/bin/git status', cwd = os.path.dirname( path ), shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE )
gitis in thePATHof the user the Python script is running as?git statusand after you said that you didsvn info!!! and i don't know if this may help but i think the error that you get mean that git is not installed in your system