Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: DLL load failed while importing _rust on v42.0.1 but not on v41.0.7 #10300

Closed
platinops opened this issue Jan 30, 2024 · 6 comments
Labels
waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.

Comments

@platinops
Copy link

platinops commented Jan 30, 2024

When I run the following code:

from cryptography import x509

I get:

  File "D:\Python\...\.venv\lib\site-packages\cryptography\x509\__init__.py", line 7, in <module>
    from cryptography.x509 import certificate_transparency, verification
  File "D:\Python\...\.venv\lib\site-packages\cryptography\x509\certificate_transparency.py", line 11, in <module>
    from cryptography.hazmat.bindings._rust import x509 as rust_x509
ImportError: DLL load failed while importing _rust: The specified procedure could not be found.

This only occurs with cryptography-42.0.1, but not with cryptography-41.0.7.

Versions used:

  • OS = Win10
  • python 3.9.0 x64
  • pip 23.3.2
  • setuptools 69.0.3
  • cffi 1.16.0

Installed cryptography through pip.

@reaperhulk
Copy link
Member

Does this occur in a brand new venv?

@platinops
Copy link
Author

platinops commented Jan 30, 2024

Had not tried it yet, but yes, the following shows the same error:

python -m venv .venv
.venv/scripts/activate
python -m pip install pip --upgrade
pip install cryptography
python -c "from cryptography import x509"

Installed packages:

>>> pip list

Package      Version
------------ -------
cffi         1.16.0
cryptography 42.0.2
pip          23.3.2
pycparser    2.21
setuptools   49.2.1

Then pip install setuptools --upgrade => still same issue.

>>> pip list

Package      Version
------------ -------
cffi         1.16.0
cryptography 42.0.2
pip          23.3.2
pycparser    2.21
setuptools   69.0.3

@alex
Copy link
Member

alex commented Jan 31, 2024

Can you provide some more context on the operating system and python you're running on?

@alex alex added the waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply. label Jan 31, 2024
@platinops
Copy link
Author

I'm running Win10 Enterprise version 10.0.19045 Build 19045 on a 64 bit virtual machine.

I downloaded the official Python 3.9.0 Windows installer from the Python website.

Any more info required?

@reaperhulk
Copy link
Member

Hmm, I've been unable to replicate this with Python 3.12.1 (64-bit) or 3.9.13 (64-bit) on a Win11 64-bit VM.

@platinops
Copy link
Author

I was able to replicate with Python 3.9.0+3.9.1 on Win11 64-bit. As from Python 3.9.2 the error no longer appears.

So upgrading Python 3.9 to the latest version solved my problem, thanks for the assist.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.
Development

No branches or pull requests

3 participants