I am trying to connect from SFTP location using paramiko in python. Below is code for that -
try:
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(
paramiko.AutoAddPolicy())
ssh_client.connect(hostname=ftp_host, username=ftp_username, password=ftp_password, port=ftp_port)
except Exception as error:
print("Error occurred while connecting to ftp server: ", error)
exit(1)
print("Established connection to file server successfully")
hostName, username, password is valid & connecting from local computer. Same script is working from local computer to fetch files from remote machine.
But, when I am trying to run SFTP on glue job, previously it through error - NoModuleFound -- paramiko
Later when I searched & added whl files of paramiko it's giving error.
ImportError: cannot import name 'asn1' from 'cryptography.hazmat.bindings._rust' (unknown
location)