[英]error: cannot run ssh: No such file or directory
I am running into an issue when trying to do a git push on a Popen() function where I get an ssh error 尝试在ssh错误的Popen()函数上执行git push时遇到问题
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? 我相信此错误是由于ssh不在我的python脚本路径中这一事实造成的? 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.
git status很好,所以我知道git命令正在工作。 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"]). 它应该包含ssh可执行文件的路径(也可以在os.environ [“ PATH”]中找到)。 It is not the same as your python search path which is in sys.path
它与sys.path中的python搜索路径不同
检查是否已安装ssh-client
,即使存在ssh密钥,也可以解决docker机器上的问题:
apt-get install ssh-client
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.