subprocess.call with rpyc throwing error

大憨熊 提交于 2020-01-03 02:46:31

问题


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)

The remote traceback is:

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?


回答1:


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.



来源:https://stackoverflow.com/questions/32087375/subprocess-call-with-rpyc-throwing-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!