-
Notifications
You must be signed in to change notification settings - Fork 3k
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: A dynamic link library (DLL) initialization routine failed after building source with Visual Studio 17.10 #21024
Comments
does it persist if you revert the change? |
One workaround I found is like the following: copy DLLs from Note that installing latest VC Runtime does not work (the downloaded VC Runtime is older than the one installed with latest Visual Studio). |
Yes, I encountered the issue before the change. |
conda uses old vc runtime and it is not compatible with new visual studio compiler. You can run "conda install conda-forge::vs2015_runtime" to upgrade your vc runtime version in conda. |
Or just delete the DLLs in conda's directories. |
In theory this should work ... Could it be a different issue? |
Oh, @tianleiwu, when you build the code you need to add "--use_binskim_compliant_compile_flags" to your build command, otherwise the changes in #21005 wouldn't take effect. It was because I asked the author to scope the change to a smaller scope that wouldn't effect most people. |
Adding |
Describe the issue
After building from source, onnxruntime cannot be imported from python in a conda environment.
To reproduce
Upgrade Visual Studio to latest stable version (Version 17.10.2), and build the main branch like the following
Then
import onnxruntime
in python under a conda environment. It shows error:In Windows event viewer, I saw an event with information like:
Note that the code has included #21005.
Urgency
No response
Platform
Windows
OS Version
Windows 11 Enterprise 10.0.22631 Build 22631
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
a2b0a69
ONNX Runtime API
Python
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: