简体   繁体   English

错误:无法运行ssh:没有此类文件或目录

[英]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.

相关问题 无法运行程序“ pip --version”(在目录“。”中):error = 2,没有这样的文件或目录 - Cannot run program “pip --version” (in directory “.”): error=2, No such file or directory PyCharm 错误:无法运行程序,错误=2,没有这样的文件或目录 - PyCharm error: Cannot run program, error=2, No such file or directory 无法运行程序(python)没有这样的文件或目录 - Cannot run program (python) No such file or directory PySpark:无法运行程序“/home/user/venv/bin/python”:错误=2,没有这样的文件或目录 - PySpark : Cannot run program “/home/user/venv/bin/python”: error=2, No such file or directory 无法在Python中打开文件“无此文件或目录”错误 - Cannot open file in Python “No such file or directory” error pycharm ssh interpter 没有那个文件或目录 - pycharm ssh interpter No such file or directory 无法从源目录外部运行 python 文件 - Cannot run python file from outside of source directory 为什么我在 macOS Catalina 下收到错误:Cannot run 'uic': “execvp: No such file or directory” for a PySide2 program? - Why do I get the error: Cannot run 'uic': “execvp: No such file or directory” for a PySide2 program under macOS Catalina? Python子进程错误:Popen,调用,运行“没有这样的文件或目录:错误 - Python subprocess error: Popen, call, run "No such file or directory: error 尝试运行openalpr错误,但遇到此错误OSError:[Errno 2]没有这样的文件或目录 - Trying to run openalpr error but this error encounter OSError: [Errno 2] No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM