-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 #11680
Comments
Please provide complete instructions for how you setup and installed everything on the machine where it did not work. |
The server is having Python 3.11. Cryptography was installed using pip install Cryptography. Installation was smooth and successful. The code uses backend, hash, pkcs7 packages of this library. Code is build on Django and running on Apache web server using wsgi. |
When I say complete instructions I mean instructions sufficient for another person to follow on a new server. |
Steps to recreate the issue are mentioned below.
import json pfx_path = "C:\certificate.pfx" #a class 3 certificate def strip_spaces(data): def load_pfx(pfx_path, pfx_password):
def sign_data(pfx_path, password, input_data):
def addSignature(json_data):
class ApiCall(APIView):
I have observred that the issue is appearing while running same code in apache web server with WSGI config. (virtualenv)<>path> py test.py test.py` import json pfx_path = "C:\certificate.pfx" def strip_spaces(data): def load_pfx(pfx_path, pfx_password):
def sign_data(pfx_path, password, input_data):
def addSignature(json_data):
Testing the functiondef main():
if name == "main": My primary observation is that, in Apache, cryptography is not able to get the required DLL. but in local run, it is able to find it. We may need to put some dlls to some other location. Please help with the list of DLLs to be copied with the source location and destination locations of the DLL. |
Unfortunately this is far too complex for us to replicate. We need a minimal reproducer that we can do in a virtual environment on a Windows machine. Millions of people install and use this project every day and it has been our experience that the vast majority of issues like this are actually problems with the user's environment rather than bugs in our code, which is why we ask for a minimal reproducer to eliminate environment problems. In your case if you can't reproduce this with a fresh virtualenv executing outside of apache, then this is an env issue that we can't really help with and you'd be better served debugging it as a more general Python pathing issue. |
Please provide the list of dependant dlls for this library and where to
find those dlls. This may help in resolving the issue by coping those dlls
to Apache dll folder.
…On Fri, 4 Oct, 2024, 07:12 Paul Kehrer, ***@***.***> wrote:
Unfortunately this is far too complex for us to replicate. We need a
minimal reproducer that we can do in a virtual environment on a Windows
machine. Millions of people install and use this project every day and it
has been our experience that the vast majority of issues like this are
actually problems with the user's environment rather than bugs in our code,
which is why we ask for a minimal reproducer to eliminate environment
problems.
In your case if you can't reproduce this with a fresh virtualenv executing
outside of apache, then this is an env issue that we can't really help with
and you'd be better served debugging it as a more general Python pathing
issue.
—
Reply to this email directly, view it on GitHub
<#11680 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANLCHFBSIOHZIHXURGRPBMTZZXXCHAVCNFSM6AAAAABPGGIKFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJSGYZDSNZQHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The DLL you’re having a problem with is a core part of the package and is distributed directly inside the wheel. Again, if you cannot provide a minimal reproducer we cannot assist. |
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 \r
from cryptography.hazmat.primitives import hashes\r
File "C:\cbsesb\cbsenv\Lib\site-packages\cryptography\hazmat\primitives\hashes.py", line 9, in \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.
The text was updated successfully, but these errors were encountered: