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

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

Open
himanshu034 opened this issue Aug 7, 2024 · 2 comments

Comments

@himanshu034
Copy link

himanshu034 commented Aug 7, 2024

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.

@jktechadventure
Copy link

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants