title: Upload file to SFTP using python
body: <p>I'm trying to upload file to SFTP server from my local directory. Here is my code</p>
  
  <pre><code>import paramiko
  import pysftp
  
  hostname = 'host'
  username='user'
  password='password'
  port=port
  source = 'c:/test.csv'
  destination = '/home/local'
  client = paramiko.SSHClient()
  client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  client.connect(hostname=hostname,port=port,username=username,password=password)
  ftp_client=client.open_sftp()
  ftp_client.put(source,destination)
  ftp_client.close()
  </code></pre>
  
  <p>I'm getting an IOError </p>
  
  <p>here is my Error. Please let me know where the error is
  <a href="https://i.stack.imgur.com/qJcA2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qJcA2.jpg" alt="enter image description here"></a></p>