0
 python3 pythonscript.py 
Traceback (most recent call last):
  File "pythonscript.py", line 1, in <module>
    import pysftp as sftp
  File "/usr/local/lib/python3.4/dist-packages/pysftp/__init__.py", line 12, in <module>
    import paramiko
  File "/usr/local/lib/python3.4/dist-packages/paramiko/__init__.py", line 30, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/usr/local/lib/python3.4/dist-packages/paramiko/transport.py", line 32, in <module>
    from cryptography.hazmat.backends import default_backend
ImportError: No module named 'cryptography'

Why am I getting the above error when I run the following script. Please note that I've tried using just python (which is 2.x) and python3 and I've installed paramiko, pycrypto, and pysftp for by 2.x and 3

import pysftp as sftp

def push_file_to_server():
    s = sftp.Connection(host='address', username='user', password='xxx')
    local_path = 'testme.txt'
    remote_path = '/home/testme.txt'

    s.put(local_path, remote_path)
    s.close()

push_file_to_server

Thanks.

2
Contributors
1
Reply
26
Views
1 Year
Discussion Span
Last Post by Gribouillis
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.