llama-cpp-python icon indicating copy to clipboard operation
llama-cpp-python copied to clipboard

Wheel build showing error of cmake suddenly - building version 0.2.76 on windows

Open himanshu034 opened this issue 1 year ago • 5 comments

I was using 0.2.76 version of llama-cpp-python previously and it was working fine on my windows machine. Now suddenly started getting error as below: Command to install: pip install --trusted-host abetlen.github.io --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu llama-cpp-python==0.2.76 --verbose

Error Building wheels for collected packages: llama-cpp-python Running command Building wheel for llama-cpp-python (pyproject.toml) *** scikit-build-core 0.10.1 using CMake 3.30.2 (wheel) *** Configuring CMake... 2024-08-08 00:19:49,159 - scikit_build_core - WARNING - Can't find a Python library, got libdir=None, ldlibrary=None, multiarch=None, masd=None loading initial cache file C:\Users\HIMANS~1\AppData\Local\Temp\tmp6mwvl7zo\build\CMakeInit.txt -- Building for: NMake Makefiles CMake Error at CMakeLists.txt:3 (project): Running

 'nmake' '-?'

failed with:

 no such file or directory

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred!

*** CMake configuration failed error: subprocess-exited-with-error

× Building wheel for llama-cpp-python (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output.

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

Please let me know if I am missing anything and it will be great to get solution for this issue.

himanshu034 avatar Aug 07 '24 18:08 himanshu034

@himanshu034

I have the same issue with you.

Mine is as attached. And my version v2.90 rather than 2.76

What I have done to date

  • I have upgraded my pip to the latest version
  • Tried installing VS code C++ build compiler to the latest version, I have Visual Studio Build Tools 2002 v17.11.2 installed
  • Also downloaded CMake v3.30 from cmake.org/ via binary distribution as it was complaining about missing Cmake however it is not solving the issue and giving me that error message attached

Any suggestion for us software experts?

Cmake error

jktechadventure avatar Sep 11 '24 19:09 jktechadventure

Hi @himanshu034,

Try this, here are my troubleshooting steps

  1. Ensure that Python is properly installed, write this on your Windows command prompt python --version Expected: Python 3.12.4 or something similar
  2. Ensure that pip is installed properly pip --version Expected: pip 24.2
  3. Ensure the latest version of Python build dependencies are installed in your machine: pip install --upgrade pip setuptools wheel scikit-build-core Expected: Successfully installed ....."scikit-build-core-0.10.6, setuptools-75.0.0, wheel-0.44.0"
  4. Check for architecture issues python -c "import struct; print(struct.calcsize('P')*8)" Expected: if your machine is 64-bit, the expected output should also be 64-bit
  5. Create a Virtual environment in your machine so it doesnt get tangled with your main machine DM if you need help with this step
  6. Check CMake installation is correct To check, type this in your Windows command prompt cmake --version Expected: cmake version 3.29.8

After getting the basics downpacked, if still facing issues with CMake Errors like I gotten them as well

Try the following advanced troubleshooting steps

  1. Ensure the required build tools are installed properly Download Microsoft Visual Studio Community 2022 (FREE VERSION) i.e. 17.11.3 Select the right components because the problems we are facing is that - missing C and C++ compilers - cannot locate NMake
  2. To solve these issues: - Run the installer .exe and in the Visual Studio Installer select Desktop development with C++ - Make sure the following components are checked: - [1] MSVC v143 - VS 2022 C++ x64/x86 build tools - Windows 11 SDK (should automatically selected) - C++ CMake tools for Windows - C++ build tools core features (should automatically selected) - NMake is automatically selected as long as Desktop development with C++ workload is selected

To verify that NMake is installed with your installation

  1. Open Developer Command Prompt in your Windows START menu

  2. Run the following command: nmake /? Expected: Microsoft (R) Program Maintenance Utility Version 14.41.34120.0 Copyright (C) Microsoft Corporation. All rights reserved.

    Usage: NMAKE @commandfile NMAKE [options] [/f makefile] [/x stderrfile] [macrodefs] [targets]

    Options: .....

SUCCESS!!! You should see that the above checker, suggest that NMake is properly installed in your machine

You can continue and that should solve your issue

Let me know how you get on

jktechadventure avatar Sep 16 '24 20:09 jktechadventure

nmake /? Expected: Microsoft (R) Program Maintenance Utility Version 14.41.34120.0 Copyright (C) Microsoft Corporation. All rights reserved. Usage: NMAKE @commandfile NMAKE [options] [/f makefile] [/x stderrfile] [macrodefs] [targets] Options: .....

SUCCESS!!! You should see that the above checker, suggest that NMake is properly installed in your machine

You can continue and that should solve your issue

Let me know how you get on

I see this and I think NMake is properly installed on my pc, but I am still facing some build issues.

bsurya27 avatar Feb 18 '25 03:02 bsurya27

facing WARNING: directory for tool cmake version 3.30.2 is present, but the tool has not been found: Tool cmake not found with error: [WinError 216] This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher ERROR: tool cmake has no installed versions. Please run 'd:\ESP\expressif\python_env\idf5.4_py3.11_env\Scripts\python.exe d:\user\rasika\v5.4.1\esp-idf\tools\idf_tools.py install' to install it. Command failed: d:\ESP\expressif\python_env\idf5.4_py3.11_env\Scripts\python.exe d:\user\rasika\v5.4.1\esp-idf\tools\idf_tools.py export --format key-value WARNING: directory for tool cmake version 3.30.2 is present, but the tool has not been found: Tool cmake not found with error: [WinError 216] This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher ERROR: tool cmake has no installed versions. Please run 'd:\ESP\expressif\python_env\idf5.4_py3.11_env\Scripts\python.exe d:\user\rasika\v5.4.1\esp-idf\tools\idf_tools.py install' to install it. this error

embeddedKeetronics123 avatar Jun 02 '25 09:06 embeddedKeetronics123

Hi jktechadventure,

I was getting this (nmake) error while installing a custom node for ComfyUI. Thanks to you, I was able to solve this problem. Thank you for the detailed explanation of the solution.

denizbuyukayak avatar Oct 19 '25 18:10 denizbuyukayak