cryptography icon indicating copy to clipboard operation
cryptography copied to clipboard

from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions ImportError: DLL load failed while importing _rust: The specified procedure could not be found.

Open dinesh1299 opened this issue 1 year ago • 7 comments

from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions ImportError: DLL load failed while importing _rust: The specified procedure could not be found.

dinesh1299 avatar Apr 26 '24 09:04 dinesh1299

If you would like help, you need to provide literally any information. How can we reproduce this? What steps did you take to install cryptography? How have you attempted to debug this?

alex avatar Apr 26 '24 10:04 alex

This issue has been waiting for a reporter response for 3 days. It will be auto-closed if no activity occurs in the next 5 days.

github-actions[bot] avatar Apr 30 '24 00:04 github-actions[bot]

I see this

Traceback (most recent call last):
  File "/app/lambda_function.py", line 13, in <module>
    import paramiko
  File "/app/lib/paramiko/__init__.py", line 22, in <module>
    from paramiko.transport import (
  File "/app/lib/paramiko/transport.py", line 33, in <module>
    from cryptography.hazmat.primitives.ciphers import algorithms, Cipher, modes
  File "/app/lib/cryptography/hazmat/primitives/ciphers/__init__.py", line 11, in <module>
    from cryptography.hazmat.primitives.ciphers.base import (
  File "/app/lib/cryptography/hazmat/primitives/ciphers/base.py", line 10, in <module>
    from cryptography.exceptions import (
  File "/app/lib/cryptography/exceptions.py", line 9, in <module>
    from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
ImportError: cannot import name 'exceptions' from 'cryptography.hazmat.bindings._rust' (unknown location)

Python3 3.12 Cryptography -> 42.0.5 Paramiko -> 3.4.0 Cffi -> 1.16.0

werebear73 avatar May 02 '24 15:05 werebear73

@werebear73 The error you're showing (along with the path that says lamdba_function.py) suggests you're attempting to run this in AWS Lambda but you've likely packaged your function with the wrong cryptography. This project uses Python extensions (native libraries) and thus requires platform and architecture specific deployments. https://cryptography.io/en/latest/faq/#i-m-getting-errors-installing-or-importing-cryptography-on-aws-lambda has links to the AWS documentation for doing this correctly.

reaperhulk avatar May 02 '24 19:05 reaperhulk

This issue has been waiting for a reporter response for 3 days. It will be auto-closed if no activity occurs in the next 5 days.

github-actions[bot] avatar May 06 '24 00:05 github-actions[bot]

@werebear73 The error you're showing (along with the path that says lamdba_function.py) suggests you're attempting to run this in AWS Lambda but you've likely packaged your function with the wrong cryptography. This project uses Python extensions (native libraries) and thus requires platform and architecture specific deployments. https://cryptography.io/en/latest/faq/#i-m-getting-errors-installing-or-importing-cryptography-on-aws-lambda has links to the AWS documentation for doing this correctly.

I tried these technics. I must be getting something wrong in translation because it is still not working.

werebear73 avatar May 06 '24 15:05 werebear73

This issue has been waiting for a reporter response for 3 days. It will be auto-closed if no activity occurs in the next 5 days.

github-actions[bot] avatar May 11 '24 00:05 github-actions[bot]

This issue has not received a reporter response and has been auto-closed. If the issue is still relevant please leave a comment and we can reopen it.

github-actions[bot] avatar May 17 '24 00:05 github-actions[bot]