microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.73k stars 2.94k forks source link

[Build] ModuleNotFoundError: No module named 'onnxruntime' #18966

Open Katooaton opened 10 months ago

Katooaton commented 10 months ago

Describe the issue

Im trying to run it... followed all instructions yet wont work

sorry if I dont put the right info into the issue log... I dont fully understand how to submit a proper one and would like some advice maybe also...

Urgency

No response

Target platform

Im on windows 10 trying to use stable diffusion

Build script

Installing collected packages: numpy, humanfriendly, coloredlogs, onnxruntime-gpu
  Attempting uninstall: numpy
    Found existing installation: numpy 1.23.5
    Uninstalling numpy-1.23.5:
      Successfully uninstalled numpy-1.23.5
ReActor preheating... Error: The 'onnxruntime-gpu' distribution was not found and is required by the application
Device: CUDA

        +---------------------------------+
        --- PLEASE, RESTART the Server! ---
        +---------------------------------+
Launching Web UI with arguments: --xformers
2023-12-31 02:43:01,844 - ControlNet - INFO - ControlNet v1.1.410
ControlNet preprocessor location: D:\aish\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-12-31 02:43:02,051 - ControlNet - INFO - ControlNet v1.1.410
*** Error loading script: console_log_patch.py
    Traceback (most recent call last):
      File "D:\aish\stable-diffusion-webui\venv\Lib\site-packages\insightface\__init__.py", line 8, in <module>
        import onnxruntime
    ModuleNotFoundError: No module named 'onnxruntime'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "D:\aish\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\aish\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 940, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "D:\aish\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\console_log_patch.py", line 4, in <module>
        import insightface
      File "D:\aish\stable-diffusion-webui\venv\Lib\site-packages\insightface\__init__.py", line 10, in <module>
        raise ImportError(
    ImportError: Unable to import dependency onnxruntime.

Error / output

Error loading script: console_log_patch.py
    Traceback (most recent call last):
      File "D:\aish\stable-diffusion-webui\venv\Lib\site-packages\insightface\__init__.py", line 8, in <module>
        import onnxruntime
    ModuleNotFoundError: No module named 'onnxruntime'

Visual Studio Version

No response

GCC / Compiler Version

No response

justinchuby commented 10 months ago

Are you trying to build onnx runtime from source? If not, simply install the required packages (onnxruntime-gpu or onnxruntime) from pip.