Skip to content
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

[BUG] llama_cpp module not found #75

Open
Fjfifnrkdo opened this issue Aug 21, 2024 · 3 comments
Open

[BUG] llama_cpp module not found #75

Fjfifnrkdo opened this issue Aug 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Fjfifnrkdo
Copy link

Describe the bug
The MacOS produces “ModuleNotFoundError: No module named ‘llama_cpp’

To Reproduce
Steps to reproduce the behavior:

  1. Try importing the node via ComfyUI manager on a MacOS device.

Expected behavior
For it to download like most nodes do already on ComfyUI, cross device compatibility.

@Fjfifnrkdo Fjfifnrkdo added the bug Something isn't working label Aug 21, 2024
@secretivebanana
Copy link

secretivebanana commented Aug 28, 2024

Had a similar or same error. I fixed it by:

  1. Close ComfyUI.
  2. Activate ComfyUI virtual environment (venv) from venv/scripts/activate.bat.
  3. In the command window: pip uninstall llama-cpp-python.
  4. Then again in command window: pip install llama-cpp-python.
  5. Re-open ComfyUI.

@hakemz91
Copy link

hakemz91 commented Oct 8, 2024

Had the issue and trying the secretivebanana fix above but it said don't have llama-cpp-python to uninstall. Then I tried to install llama-cpp-python then it said scikit_build_core is missing...then I install that scikit_build_core and run again the pip llama-cpp-python..and it took like a while to build the wheel but fortunately it successful eventually. Feel so good to get rid of the annoying red error text. So here is the command for fixing it in my case, which need to be run in root folder of comfyui (where folder python_embeded located, open cmd here):

.\python_embeded\python.exe -m pip install scikit_build_core
.\python_embeded\python.exe -m pip install llama-cpp-python

@reefor
Copy link

reefor commented Oct 30, 2024

Thanks Hakem91

When running the 2nd command I got this error. (I'm running Comfyui Portable on a Windows machine)

Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
2024-10-30 17:41:11,213 - scikit_build_core - WARNING - Could not determine CMake version via --version, got '' 'Traceback (most recent call last):\n File "", line 198, in _run_module_as_main\n File "", line 88, in run_code\n File "C:\Users\Paul\AppData\Local\Temp\pip-build-env-mevksaai\normal\Scripts\cmake.EXE\main.py", line 4, in \nModuleNotFoundError: No module named 'cmake'\n'
Traceback (most recent call last):
File "C:\Users\Paul\Desktop\Comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\Users\Paul\Desktop\Comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Paul\Desktop\Comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 149, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Paul\Desktop\Comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\scikit_build_core\build_init
.py", line 96, in prepare_metadata_for_build_wheel
return _build_wheel_impl(
^^^^^^^^^^^^^^^^^^
File "C:\Users\Paul\Desktop\Comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\scikit_build_core\build\wheel.py", line 175, in _build_wheel_impl
return _build_wheel_impl_impl(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Paul\Desktop\Comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\scikit_build_core\build\wheel.py", line 242, in _build_wheel_impl_impl
cmake = CMake.default_search(version=settings.cmake.version, env=os.environ)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Paul\Desktop\Comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\scikit_build_core\cmake.py", line 63, in default_search
raise CMakeNotFoundError(msg)
scikit_build_core.errors.CMakeNotFoundError: Could not find CMake with version >=3.21
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

When I boot up Comfyui I still get the "ModuleNotFoundError: No module named 'llama_cpp'" error, but it's not in red for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants