2

I downloaded Anaconda for python usages on windows. I'm using paramiko module for SSH. When i try to do SSH connect using paramiko, i'm getting following error,

Traceback (most recent call last):
File "C:\Users\Anaconda2\lib\site-packages\paramiko\transport.py", line 545, in start_client
raise e
ImportError: DLL load failed: The operating system cannot run %1.

I tried setting "C:\Users\*****\Anaconda2\Library\bin" path to the environmental variable. But no use in it. Still the error continuous.

Code snippet:

import paramiko
sftpSession = None
sshSession = paramiko.SSHClient()
sshSession.set_missing_host_key_policy(paramiko.AutoAddPolicy())
sshSession.connect(hostname=hostname,username=username,password=password,timeout=2)
Anand
  • 343
  • 1
  • 5
  • 18

2 Answers2

5

I uninstalled and reinstalled cryptography package with latest version. Now, SSH connect is working without any errors.

pip uninstall cryptography

pip install cryptography

Anand
  • 343
  • 1
  • 5
  • 18
1

Found some advice in here:

  1. Create a new conda environment (i.e.: conda create -n paramiko-env python=3)
  2. Activate the environment (activate paramiko-env)
  3. Run: conda install -c conda-forge paramiko maybe you can try it
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
johnII
  • 1,423
  • 1
  • 14
  • 20