title: PYSFTP script to Upload and Download
body: <p>I need some help I'm getting below message when i try to connect. The script Im executing is below. Any suggestions as to how I can fix this issue? </p>
  
  <p>Also, once I get this issue fixed Im looking to add to this script the ability to listen until the result file is available and to download it from a different remote directory.</p>
  
  <p>Thank you, in advance </p>
  
  <pre><code>No hostkey for host mysftpserver.com found.
  Exception AttributeError: "'Connection' object has no attribute 
  '_sftp_live'" in &lt;bound method Connection.__del__ of &lt;pysftp.Connection 
  object at 0x101d8cd50&gt;&gt; ignored
  
  Process finished with exit code 0
  </code></pre>
  
  <p>Script</p>
  
  <pre><code>import pysftp as sftp
  
  def sftpExample():
  
      try:
          s = sftp.Connection(host='mysftpserver', port=1211, username='myusername', password='mypassword')
  
          remotepath='/Orders/incoming/myfile.csv'
          localpath='/Users/myusername/projects/order88.csv'
          s.put(localpath,remotepath)
  
          s.close()
  
      except Exception, e:
          print str(e)
  
  sftpExample()
  </code></pre>