<div dir="ltr">This is the same underlying issue as <a href="https://github.com/matplotlib/matplotlib/issues/28551">https://github.com/matplotlib/matplotlib/issues/28551</a> .  <div><br></div><div>Summarizing that issue to bring to the attention of pypa has been on my todo backlog for a while.  This may be a cleaner case to bring to pypa with a more contemporaneous reproducer.<div><br></div><div>Tom</div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sun, Nov 23, 2025 at 7:12 AM Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 23/11/2025 00:52, Marius Wanko wrote:<br>
> Hi,<br>
> <br>
> I encountered an access violation (0xC0000005) when importing <br>
> onnxruntime<br>
> along PyQt6 on Windows 10/11. On the python end this raises <br>
> "ImportError:<br>
> DLL load failed while importing onnxruntime_pybind11_state: A dynamic <br>
> link<br>
> library (DLL) initialization routine failed."<br>
> <br>
> I tracked it down to the system DLLs vcruntime140*.dll and <br>
> msvcp140*.dll,<br>
> which are bundled in the PyQt6 PyPI wheels (Qt6/bin/) whereas <br>
> onnxruntime<br>
> seem to be compiled against the corresponding system dlls (I checked<br>
> dependencies). If PyQt6 is imported first, the crash occurs when<br>
> onnxruntime initializes. The Windows SDK debugger shows me<br>
> "MSVCP140!mtx_do_lock" in the stack trace. When I delete the bundled <br>
> dlls,<br>
> the error disappears and onnxruntime works as expected.<br>
> <br>
> I just wanted to communicate this, I'm not going to argue whether the<br>
> bundling is a good idea or not.<br>
> <br>
> Marius<br>
<br>
I don't know if it is a good idea either. Does anybody know what current <br>
best practice is?<br>
<br>
Historically I don't think you could depend on those DLLs being already <br>
installed. I would hope that that has changed.<br>
<br>
Phil<br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Thomas Caswell<br><a href="mailto:tcaswell@gmail.com" target="_blank">tcaswell@gmail.com</a></div>