I am running into an issue when trying to do a git push on a Popen() function where I get an ssh error
error: cannot run ssh: No such file or directory
fatal: unable to fork
I believe this error is due to the fact that ssh is not in my python scripts path? If that is the case what would be the best way for me to handle this?
Here is my function call in case it would help
subprocess.Popen( 'git push', shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE )
also as an aside. git status works great so I know the git commands are working. it just chokes when it goes to interact with the server.
Look at the output of
subprocess.Popen("echo $PATH",shell=True)
it should contain the path of your ssh executable (also to be found in os.environ["PATH"]). It is not the same as your python search path which is in sys.path
检查是否已安装ssh-client
,即使存在ssh密钥,也可以解决docker机器上的问题:
apt-get install ssh-client
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.