user3515538
user3515538

Reputation: 11

pysftp.CnOpts() reports "ImportError: DLL load failed: The specified procedure could not be found"

i am using Python 3.7.0 library pysftp version 0.2.9

i don't know why whenever i run the below command i will have DLL load failed error. It is very annoying as i can't find a easy way to sftp to my remote server using python

**>>> import pysftp

cnopts = pysftp.CnOpts()**

ImportError: DLL load failed: The specified procedure could not be found.

(base) C:\Users\User>python Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

import pysftp cnopts = pysftp.CnOpts() Traceback (most recent call last): File "", line 1, in File "C:\Users\User\Anaconda3\lib\site-packages\pysftp__init__.py", line 54, in init self.hostkeys.load(knownhosts) File "C:\Users\User\Anaconda3\lib\site-packages\paramiko\hostkeys.py", line 97, in load e = HostKeyEntry.from_line(line, lineno) File "C:\Users\User\Anaconda3\lib\site-packages\paramiko\hostkeys.py", line 360, in from_line key = ECDSAKey(data=decodebytes(key), validate_point=False) File "C:\Users\User\Anaconda3\lib\site-packages\paramiko\ecdsakey.py", line 168, in init self.verifying_key = numbers.public_key(backend=default_backend()) File "C:\Users\User\Anaconda3\lib\site-packages\cryptography\hazmat\backends__init__.py", line 15, in default_backend from cryptography.hazmat.backends.openssl.backend import backend File "C:\Users\User\Anaconda3\lib\site-packages\cryptography\hazmat\backends\openssl__init__.py", line 7, in from cryptography.hazmat.backends.openssl.backend import backend File "C:\Users\User\Anaconda3\lib\site-packages\cryptography\hazmat\backends\openssl\backend.py", line 62, in from cryptography.hazmat.bindings.openssl import binding File "C:\Users\User\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 14, in from cryptography.hazmat.bindings._openssl import ffi, lib **ImportError: DLL load failed: The specified procedure could not be found. **

Upvotes: 0

Views: 1142

Answers (1)

Ahmed Abdelmoneim
Ahmed Abdelmoneim

Reputation: 29

Same problem happened to me, seems like an issue with cryptography library, reinstalling it fixed it for me. You can re-install it using pip:

pip install cryptography --force-reinstall

Upvotes: 1

Related Questions