-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: Unable to import dependency onnxruntime #24120
Comments
Most likely it was because your VC Runtime version was too old. If you could put it into a debugger(for example, Visual Studio), the debugger can tell you where msvcp140.dll was loaded. Then right click the file and check its version number from the file properties. |
Try install nightly build: https://onnxruntime.ai/docs/install/#install-onnx-runtime-gpu-cuda-12x When PyTorch is installed, you can walkaround this issue by using onnxruntime.preload_dlls(), see: |
I have tried to install nightly build. But got the same error.
no more DLL missing information. I guest #24053 feature is about provider dll loading, not about onnxruntime_pybind11_state.pyd itself. Now, it's onnxruntime_pybind11_state.pyd loading error. my python is |
Try upgrade your VC Runtime: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 |
I have reinstalled latest vc_redist before I installed nightly build onnx. No help. |
But, python lib file \Lib\site-packages\onnxruntime\capi\onnxruntime_pybind11_state.pyd There is "api-ms-win-core-path-l1-1-0.dll" in import table of onnxruntime_pybind11_state.pyd I don't know if that is the reason, and how to install "api-ms-win-core-path-l1-1-0.dll". |
hello Guys,
anyone knows how to solve this issue for comfyui,
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface_init_.py", line 8, in
import onnxruntime
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime_init_.py", line 61, in
raise import_capi_exception
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime_init_.py", line 24, in
from onnxruntime.capi._pybind_state import (
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi_pybind_state.py", line 32, in
from .onnxruntime_pybind11_state import * # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing onnxruntime_pybind11_state: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in call_with_frames_removed
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ReActor_init.py", line 23, in
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ReActor\nodes.py", line 15, in
from insightface.app.common import Face
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface_init_.py", line 10, in
raise ImportError(
ImportError: Unable to import dependency onnxruntime.
Cannot import E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ReActor module for custom nodes: Unable to import dependency onnxruntime.
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
Traceback (most recent call last):
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface_init_.py", line 8, in
import onnxruntime
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime_init_.py", line 61, in
raise import_capi_exception
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime_init_.py", line 24, in
from onnxruntime.capi._pybind_state import (
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi_pybind_state.py", line 32, in
from .onnxruntime_pybind11_state import * # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing onnxruntime_pybind11_state: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in call_with_frames_removed
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_pulid_flux_ll_init.py", line 1, in
from .pulidflux import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_pulid_flux_ll\pulidflux.py", line 6, in
from insightface.utils.download import download_file
File "E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface_init_.py", line 10, in
raise ImportError(
ImportError: Unable to import dependency onnxruntime.
Cannot import E:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_pulid_flux_ll module for custom nodes: Unable to import dependency onnxruntime.
The text was updated successfully, but these errors were encountered: