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
Getting error while importing ssl " import _ssl # if we can't import it, let the error propagate ImportError: DLL load failed while importing _ssl: The specified module could not be found." #83525
Comments
We have built python3.7.5 and python3.8.1 source code in windows 10 machine. I have created an embedded interptreter where i am trying to "import ssl" but it is failing with error "Journal execution results for D:\workdir\PR\9616145\9616145\journal.py...
Syntax errors:
Line 98: Traceback (most recent call last):
File "D:\workdir\PR\9616145\9616145\journal.py", line 1, in <module>
import ssl
File "<frozen zipimport>", line 259, in load_module
File "D:\workdir\PR\PRUnits\PythonIssuefix381\wntx64\kits\nxbin\python\Python38.zip\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed while importing _ssl: The specified module could not be found." This error was coming from python 3.7.4 and it was working fine till python 3.7.3. There is also one work around if i replaced _ssl.pyd with python3.7.3 _ssl.pyd it is working fine. I also found python 3.7.3 is using openssl-1.1.1c where as python3.7.5 and python3.8.1 is using openssl- 1.1.1d. I have also checked in using python 3.7.5 installing and import ssl is working fine. I have also checked that _ssl.pyd in installer and _ssl.pyd is created by manually built size is different. I am not getting the exact root cause what has happened. Could you please me i have already stucked and not able to work. |
It sounds like Python cannot load the OpenSSL DLLs or a dependency of the OpenSSL DLLs. IIRC the libraries are called libssl.dll and libcrypto.dll. The files must be in the current DLL search path. |
More precisely, make sure the libcrypto-1_1.dll and libssl-1_1.dll files are in the same directory as your _ssl.pyd, but _not_ inside your Python38.zip file (zip import does not support native modules, they have to be outside of the zip). |
Thanks all for your quick response. That issue has been resolved by On Thu, Jan 16, 2020 at 2:41 AM Steve Dower <report@bugs.python.org> wrote:
-- |
This definitely works: https://bugs.python.org/issue39344%5C%3E Another reference:https://stackoverflow.com/questions/54175042/python-3-7-anaconda-environment-import-ssl-dll-load-fail-error |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: