title: Getting error messages while run a python code for execute a command in remotely linux server (ksh: spawn: not found)
body: <p>I hope everyone is good , i just work with one python code for check status for spawn status , but always shown me this error message , while When i went to the server and write the same command it is working without any error.
  path of the spawn in my server is :</p>
  <pre><code>Server01:&gt; which spawn
  /st/ex/sap/spawn/bin/spawncmd  
  </code></pre>
  <p>ksh: spawn: not found</p>
  <pre><code>    import paramiko
      
      
      hostname = &quot;yyy.com&quot;
      user = &quot;me&quot;
      password = 'hello'
      commands = [  # &quot;df -h&quot;,
          
          # &quot;pwd&quot;
          &quot;spawn status&quot;
      
      ]
      client = paramiko.SSHClient()
      client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
      try:
          client.connect(hostname=hostname, username=user, password=password)
      except:
          print(&quot;can not do it &quot;)
          exit()
      for command in commands:
          print(&quot;command&quot;, command, &quot;commands&quot;)
          stdin, stdout, stderr = client.exec_command(command)
          print(stdout.read().decode())
          err = stderr.read().decode()
          if err:
              print(err)
  </code></pre>
  <p>Any creative idea to solve this</p>