带有rpyc抛出错误的subprocess.call [英] subprocess.call with rpyc throwing error

查看:194
本文介绍了带有rpyc抛出错误的subprocess.call的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用RPyc在远程计算机上执行命令.运行以下代码时出现错误:

I am using RPyc to execute commands on remote machine. I am getting error when I run the following code:

cmd = ['clonetst.exe', 'C:\\Users\\pqalinux\\Desktop\\Flowcontrol.tst', 'C:\\Users\\pqalinux\\Desktop\\lst_20150819_110008.lst', 'C:\\Users\\pqalinux\\Desktop\\tst_20150819_110008.tst']
self.host = rpyc.classic.connect(self.ip)
StatusCode = self.host.modules.subprocess.check_call(cmd)

远程回溯是:

Failed to create tst file: [Errno 2] The system cannot find the file specified

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\rpyc\core\protocol.py", line 305, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\rpyc\core\protocol.py", line 535, in _handle_call
    return self._local_objects[oid](*args, **dict(kwargs))
  File "C:\Program Files (x86)\IronPython 2.7\Lib\subprocess.py", line 507, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Program Files (x86)\IronPython 2.7\Lib\subprocess.py", line 494, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Program Files (x86)\IronPython 2.7\Lib\subprocess.py", line 675, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files (x86)\IronPython 2.7\Lib\subprocess.py", line 887, in _execute_child
    hp, ht, pid, tid = _subprocess.CreateProcess(executable, args,
WindowsError: [Errno 2] The system cannot find the file specified

可能是什么问题?有什么想法吗?

What might be the problem? Any ideas?

推荐答案

远程计算机上未安装'clonetst.exe',或者path或当前目录中均未安装它.确保已安装它,然后将其永久添加到path或添加到环境词典中.

Either 'clonetst.exe' is not installed on the remote machine or it is neither on the path nor in the current directory. Make sure it is installed and either add to the path permanently or in the environment dictionaries.

这篇关于带有rpyc抛出错误的subprocess.call的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆