ComfyUI-3D-Pack icon indicating copy to clipboard operation
ComfyUI-3D-Pack copied to clipboard

RuntimeError: Ninja is required to load C++ extension (ComfyUI Portable)

Open cupret opened this issue 1 year ago • 8 comments

Trying to install ComfyUI-3D-Pack in Comfyui Portable through manager but sadly it fail to import.

Warn!: Traceback (most recent call last):
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1931, in load_custom_node
    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:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\__init__.py", line 47, in <module>
    module = importlib.import_module(f".{nodes_filename}", package=__name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 78, in <module>
    from Unique3D.scripts.project_mesh import multiview_color_projection, get_cameras_list
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 99, in <module>
    pix2faces_renderer = Pix2FacesRenderer()
                         ^^^^^^^^^^^^^^^^^^^
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 71, in __init__
    self._glctx = dr.RasterizeGLContext(output_db=False, device=device)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 177, in __init__
    self.cpp_wrapper = _get_plugin().RasterizeCRStateWrapper(cuda_device_idx)
                       ^^^^^^^^^^^^^
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 118, in _get_plugin
    torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=opts, extra_cuda_cflags=opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False)
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1309, in load
    return _jit_compile(
           ^^^^^^^^^^^^^
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1719, in _jit_compile
    _write_ninja_file_and_build_library(
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1802, in _write_ninja_file_and_build_library
    verify_ninja_availability()
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1852, in verify_ninja_availability
    raise RuntimeError("Ninja is required to load C++ extensions")
RuntimeError: Ninja is required to load C++ extensions

Warn!: Cannot import D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: Ninja is required to load C++ extensions
### Loading: ComfyUI-Manager (V2.48.1)
### ComfyUI Revision: 2359 [29c2e267] | Released on '2024-07-12'

Already tried python_embeded\python.exe -s -m pip install --force-reinstall ninja. I even slip subprocess command to get pip list (as json) in the code to see the installed package, the ninja package clearly installed but the error still persist.

pip_list.json

Any Idea to solve this problem is appreciated!

cupret avatar Jul 24 '24 15:07 cupret

@cupret Hi, I think someone had a similar issue before, couldn't find it though, but to solve it, you need to add D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Scripts into your environment path variable and move it onto the top of list The reason is, your system is trying use Ninja somewhere else, but it is not installed correctly at the location where your system is looking. Let me know if that solves your problem, cheers

MrForExample avatar Jul 24 '24 18:07 MrForExample

@cupret Hi, I think someone had a similar issue before, couldn't find it though, but to solve it, you need to add D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Scripts into your environment path variable and move it onto the top of list The reason is, your system is trying use Ninja somewhere else, but it is not installed correctly at the location where your system is looking. Let me know if that solves your problem, cheers

Thanks for the reply. While the the ninja error is gone, a new error appeared.

Warn!: Traceback (most recent call last):
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1931, in load_custom_node
    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:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\__init__.py", line 47, in <module>
    module = importlib.import_module(f".{nodes_filename}", package=__name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 78, in <module>
    from Unique3D.scripts.project_mesh import multiview_color_projection, get_cameras_list
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 98, in <module>
    pix2faces_renderer = Pix2FacesRenderer()
                         ^^^^^^^^^^^^^^^^^^^
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 70, in __init__
    self._glctx = dr.RasterizeGLContext(output_db=False, device=device)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 221, in __init__
    self.cpp_wrapper = _get_plugin(gl=True).RasterizeGLStateWrapper(output_db, mode == 'automatic', cuda_device_idx)
                       ^^^^^^^^^^^^^^^^^^^^
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 118, in _get_plugin
    torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=opts, extra_cuda_cflags=opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False)
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1309, in load
    return _jit_compile(
           ^^^^^^^^^^^^^
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1745, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2144, in _import_module_from_library
    module = importlib.util.module_from_spec(spec)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing nvdiffrast_plugin_gl: The specified module could not be found.

Warn!: Cannot import D:\SD\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: DLL load failed while importing nvdiffrast_plugin_gl: The specified module could not be found.
### Loading: ComfyUI-Manager (V2.48.1)
### ComfyUI Revision: 2359 [29c2e267] | Released on '2024-07-12'

It seems its trying to install/import file nvdiffrast_plugin_gl.pyd from C:\Users\User\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu121\nvdiffrast_plugin_gl\, yet there is no such file, only a file named build.ninja exist on that directory. I suspect there somethings wrong with how ninja build the extensions, yet there is no error thrown from ninja. (I already have VS2022 installed with c++ component)

cupret avatar Jul 25 '24 03:07 cupret

I am also getting a similar error, though I do have a nvdiffrast_plugin_gl.pyd file in C:\Users\User\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu121\nvdiffrast_plugin_gl.

Warn!: Traceback (most recent call last):
  File "C:\Users\bmlzootown\Desktop\ComfyUI_3D\ComfyUI\nodes.py", line 1941, in load_custom_node
    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 "C:\Users\bmlzootown\Desktop\ComfyUI_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\__init__.py", line 53, in <module>
    module = importlib.import_module(f".{nodes_filename}", package=__name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\bmlzootown\Desktop\ComfyUI_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 80, in <module>
    from Unique3D.scripts.project_mesh import multiview_color_projection, get_cameras_list
  File "C:\Users\bmlzootown\Desktop\ComfyUI_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 98, in <module>
    pix2faces_renderer = Pix2FacesRenderer()
                         ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bmlzootown\Desktop\ComfyUI_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 70, in __init__
    self._glctx = dr.RasterizeGLContext(output_db=False, device=device)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bmlzootown\Desktop\ComfyUI_3D\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 221, in __init__
    self.cpp_wrapper = _get_plugin(gl=True).RasterizeGLStateWrapper(output_db, mode == 'automatic', cuda_device_idx)
                       ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bmlzootown\Desktop\ComfyUI_3D\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 118, in _get_plugin
    torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=opts, extra_cuda_cflags=opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False)
  File "C:\Users\bmlzootown\Desktop\ComfyUI_3D\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1309, in load
    return _jit_compile(
           ^^^^^^^^^^^^^
  File "C:\Users\bmlzootown\Desktop\ComfyUI_3D\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1745, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bmlzootown\Desktop\ComfyUI_3D\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2143, in _import_module_from_library
    module = importlib.util.module_from_spec(spec)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing nvdiffrast_plugin_gl: The specified module could not be found.

Warn!: Cannot import C:\Users\bmlzootown\Desktop\ComfyUI_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: DLL load failed while importing nvdiffrast_plugin_gl: The specified module could not be found.
### Loading: ComfyUI-Manager (V2.48.5)
### ComfyUI Revision: 2452 [ea03c9dc] | Released on '2024-08-02'

issue

bmlzootown avatar Aug 03 '24 19:08 bmlzootown

Open a cmd window, navigate to the location of build.ninja, and manually build it. I think the command is 'ninja build.ninja'

This will almost certainly fail, but it will tell you the errors that got suppressed when Comfyui tried it

Duodecimus avatar Aug 04 '24 08:08 Duodecimus

DLL not found is just a pathing issue. Either add the path to the pyd file to your environment path, or copy them to somewhere they will be found. I copied the whole folder to python\Lib\site-packages\nvdiffrast_plugin_gl

Duodecimus avatar Aug 04 '24 08:08 Duodecimus

@cupret Hi, I think someone had a similar issue before, couldn't find it though, but to solve it, you need to add D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Scripts into your environment path variable and move it onto the top of list The reason is, your system is trying use Ninja somewhere else, but it is not installed correctly at the location where your system is looking. Let me know if that solves your problem, cheers

In my case, ComfyUI-3D-Pack became unimportable after updating it in comfyui manager. The same thing happened to me and it won't import. I'm not sure how to fix it by changing the environment path variable, would appreciate it if you could let me know.

  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\__init__.py", line 53, in <module>
    module = importlib.import_module(f".{nodes_filename}", package=__name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 80, in <module>
    from Unique3D.scripts.project_mesh import multiview_color_projection, get_cameras_list
  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 98, in <module>
    pix2faces_renderer = Pix2FacesRenderer()
                         ^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 70, in __init__
    self._glctx = dr.RasterizeGLContext(output_db=False, device=device)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 221, in __init__
    self.cpp_wrapper = _get_plugin(gl=True).RasterizeGLStateWrapper(output_db, mode == 'automatic', cuda_device_idx)
                       ^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 118, in _get_plugin
    torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=opts, extra_cuda_cflags=opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False)
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1309, in load
    return _jit_compile(
           ^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1719, in _jit_compile
    _write_ninja_file_and_build_library(
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1802, in _write_ninja_file_and_build_library
    verify_ninja_availability()
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1851, in verify_ninja_availability
    raise RuntimeError("Ninja is required to load C++ extensions")
RuntimeError: Ninja is required to load C++ extensions

yjktech avatar Aug 08 '24 07:08 yjktech

I'm not sure how to fix it by changing the environment path variable, would appreciate it if you could let me know.

Now I have exate the same problem. I have successfully install 3d-pack:

屏幕截图 2024-09-21 192418 屏幕截图 2024-09-21 220531

but I still have the same problem of node:

Warn!: xFormers is available (Attention) Warn!: D:\SD\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST']. warnings.warn(

Warn!: Traceback (most recent call last): File "D:\SD\ComfyUI\nodes.py", line 1993, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in call_with_frames_removed File "D:\SD\ComfyUI\custom_nodes\ComfyUI-3D-Pack_init.py", line 53, in module = importlib.import_module(f".{nodes_filename}", package=name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "importlib_init_.py", line 126, in import_module File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\SD\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 82, in from Unique3D.scripts.project_mesh import multiview_color_projection, multiview_color_projection_texture, get_cameras_list, get_orbit_cameras_list File "D:\SD\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 99, in pix2faces_renderer = Pix2FacesRenderer() ^^^^^^^^^^^^^^^^^^^ File "D:\SD\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 71, in init self._glctx = dr.RasterizeGLContext(output_db=False, device=device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 221, in init self.cpp_wrapper = _get_plugin(gl=True).RasterizeGLStateWrapper(output_db, mode == 'automatic', cuda_device_idx) ^^^^^^^^^^^^^^^^^^^^ File "D:\SD\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 118, in _get_plugin torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=opts, extra_cuda_cflags=opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False) File "D:\SD\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1312, in load return _jit_compile( ^^^^^^^^^^^^^ File "D:\SD\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1747, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2141, in _import_module_from_library module = importlib.util.module_from_spec(spec) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: DLL load failed while importing nvdiffrast_plugin_gl: 找不到指定的模块。

Warn!: Cannot import D:\SD\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: DLL load failed while importing nvdiffrast_plugin_gl: 找不到指定的模块。

felixsoong0825 avatar Sep 21 '24 14:09 felixsoong0825

@cupret Hi, I think someone had a similar issue before, couldn't find it though, but to solve it, you need to add D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Scripts into your environment path variable and move it onto the top of list The reason is, your system is trying use Ninja somewhere else, but it is not installed correctly at the location where your system is looking. Let me know if that solves your problem, cheers

This solved the error RuntimeError: Ninja is required to load C++ extension for me. Thank you.

alexisrolland avatar Jan 05 '25 10:01 alexisrolland

do you have Visual Studio Build Tools installed? Installation guide: https://github.com/bycloudai/InstallVSBuildToolsWindows

DenisKochetov avatar Aug 03 '25 18:08 DenisKochetov

@cupret你好,我想之前有人遇到过类似的问题,虽然没找到,但为了解决这个问题,你需要把它添加D:\SD\ComfyUI\ComfyUI_windows_portable\python_embeded\Scripts到环境路径变量中,并把它移到列表顶部。 原因是你的系统正在尝试在其他地方使用 Ninja,但它并没有正确安装在你系统正在查找的位置。 如果解决了你的问题,请告诉我,谢谢。

This worked for me, thank you very much

lxk61688 avatar Aug 19 '25 07:08 lxk61688