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

Django DRF error DLL Load Failed while importing _rust in Python 3.11.3 venv in Windows Server 2022 with cryptography-43.0.1-cp39-abi3-win_amd64.whl #11587

Open
alinganpatra20004 opened this issue Sep 12, 2024 · 3 comments
Labels
Stale waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.

Comments

@alinganpatra20004
Copy link

My code is working in local environment of windows10 with venv on Python 3.10.11. However, on deploying in Windows Server 2022 with Apache2 webserver with venv on Python 3.11.3 getting following error. I have trying upgrading, installing binary. Till now issue is not resolved. Can anyone help in getting the issue resolved?

other packages in problematic environment are cffi-1.17.1 cryptography-43.0.1 pycparser-2.22

from cryptography.hazmat.primitives.asymmetric import padding\r
  File "C:\\cbsesb\\cbsenv\\Lib\\site-packages\\cryptography\\hazmat\\primitives\\asymmetric\\padding.py", line 9, in <module>\r
    from cryptography.hazmat.primitives import hashes\r
  File "C:\\cbsesb\\cbsenv\\Lib\\site-packages\\cryptography\\hazmat\\primitives\\hashes.py", line 9, in <module>\r
    from cryptography.hazmat.bindings._rust import openssl as rust_openssl\r
ImportError: DLL load failed while importing _rust: The specified module could not be found.\r
Package                 Version
----------------------- ---------
asgiref                 3.7.1
certifi                 2023.7.22
cffi                    1.17.1
charset-normalizer      3.3.2
cryptography            43.0.1
cx-Oracle               8.3.0
defusedxml              0.7.1
dicttoxml               1.7.16
Django                  4.2.1
djangorestframework     3.14.0
djangorestframework-xml 2.0.0
idna                    3.6
ldap3                   2.9.1
lxml                    4.9.3
mod-wsgi                4.9.4
pip                     24.2
psycopg2                2.9.6
pyasn1                  0.6.0
pycparser               2.22
pycryptodome            3.18.0
pyOpenSSL               24.2.1
pytz                    2023.3
requests                2.31.0
setuptools              74.1.2
signxml                 3.2.1
soupsieve               2.5
sqlparse                0.4.4
typing_extensions       4.6.1
tzdata                  2023.3
urllib3                 2.2.0
xmltodict               0.12.0

Tried to update the setup tools but did not worked

python -m pip install --upgrade pip setuptools

Tried to downgrade the Python to 3.10 but did not worked.

installing Rust doesn't work.

Tried installing binary for cryptography but did not worked.

python -m pip install cryptography --only-binary cryptography

@alex
Copy link
Member

alex commented Sep 12, 2024

I'm not familiar with this error, however some Googling suggests other people resolved similar errors by installing https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

@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 Sep 12, 2024
@alinganpatra20004 alinganpatra20004 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
@alinganpatra20004
Copy link
Author

I'm not familiar with this error, however some Googling suggests other people resolved similar errors by installing https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

@alex , Thanks for suggesting this approach. However, the issue has not been resolved even after installing the latest Microsoft Visual C++ version, 2015-2022. I am getting the same error.

Copy link

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 github-actions bot added the Stale label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale 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

2 participants