title: file pull from SFTP using python
body: <pre><code>from msilib.schema import Directory
  import pysftp
  import os
  import glob
  import fnmatch
  from datetime import date, timedelta
   
  cnopts = pysftp.CnOpts()
  
  cnopts.hostkeys = None
  
  myHostname = 'sftp.mmm.com'
  myUsername = 'uuuu'
  myPassword = 'pass'
  
  with pysftp.Connection(host=myHostname, username=myUsername, password=myPassword, cnopts=cnopts) as sftp:
      print(&quot;Connection Success&quot;)
  
  remotefilepath='/REPORTING/test.zip'
  
  localfilepath='Z:\\data\\sftp_data\\'
  
  sftp.get(remotefilepath,localfilepath)
  </code></pre>
  <p>Hi All
  I have been using above code to pull the file from SFTP and save locally
  However i am getting below error</p>
  <p>chan = t.open_session(
  AttributeError: 'NoneType' object has no attribute 'open_session'</p>
  <p>Please advise</p>