Windows(conda环境)安装onnxruntime问题记录


参考:官方解决方案

问题:

ImportError: DLL load failed while importing onnxruntime_genai: A dynamic link library (DLL) initialization routine failed.
  File "D:\Python\envs\llm\Lib\site-packages\onnxruntime\__init__.py", line 74, in <module>
    raise import_capi_exception
  File "D:\Python\envs\llm\Lib\site-packages\onnxruntime\__init__.py", line 24, in <module>
    from onnxruntime.capi._pybind_state import (
  File "D:\Python\envs\llm\Lib\site-packages\onnxruntime\capi\_pybind_state.py", line 32, in <module>
    from .onnxruntime_pybind11_state import *  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing onnxruntime_pybind11_state: 动态链接库(DLL)初始化例程失败。

解决:

conda install conda-forge::vs2015_runtime

声明:烈火灼冰|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - Windows(conda环境)安装onnxruntime问题记录


离离沐雪踏轻尘