I want to run scp command in subprocess.Popen(cmd) like
self.p = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf-8')
(self.out, self.err) = self.p.communicate()
but file is being downloaded but it shows cp: cannot stat 'ssh': No such file or directory and return retuncode 1.
How can I get rid of this error?