Search code examples
pythonparamikobcrypt

How to Fix: ImportError: DLL load failed while importing _bcrypt: The specified procedure could not be found


I'm currently facing an issue with importing the _bcrypt module in Python, and I would greatly appreciate any help or insights you can provide.

I am using Python 3.9 on a Windows 10 Pro machine. the code calls paramiko which calls bcrypt When I try to import paramiko, I encounter the following error:


Traceback (most recent call last):
  File "d:\remote_conn\client-copy.py", line 44, in        

    import sys, os, paramiko, time

  File "C:\Python39\lib\site-packages\paramiko\__init__.py", line 22, in  

    from paramiko.transport import (

  File "C:\Python39\lib\site-packages\paramiko\transport.py", line 93, in 

    from paramiko.dsskey import DSSKey

  File "C:\Python39\lib\site-packages\paramiko\dsskey.py", line 37, in 

    from paramiko.pkey import PKey

  File "C:\Python39\lib\site-packages\paramiko\pkey.py", line 32, in 

    import bcrypt

  File "C:\Python39\lib\site-packages\bcrypt\__init__.py", line 13, in 

    from ._bcrypt import (

ImportError: DLL load failed while importing `_bcrypt`: The specified procedure could not be found.

I have already attempted the following troubleshooting steps:

  • updated all packages
  • Installed Microsoft Visual C++ Redistributable for Visual Studio 2015-20122 (x86/x64) and Microsoft Visual C++ Redistributable 2013 (x64).
  • Installed OpenSSL with Git .
  • Checked that the directory containing the DLL files is included in the PATH environment variable (C:\Windows\system32, C:\Python39\DLLs).
  • Despite these efforts, the error persists. Could you please provide any suggestions or insights on how to resolve this issue? Is there anything I might be missing or any alternative approaches I could try? or how to know which DLLs files need?

Thank you in advance for your help!

Best regards


Solution

  • I ran into the same issue for latest versions of paramiko(3.4.0) and bcrypt(4.1.2). I tried installing a lower version of bcrypt but should be >=3.2 as latest paramiko version(3.4.0) requires bcrypt>=3.2. This worked for me.