errors encountered while Installing llama-cpp-python

160 views Asked by At

I am trying to install llama-cpp-python, unable to resolve errors, mainly, related to CMake.

using anaconda distribution, environment: Python 3.10.13 OS : Windows

Tried many things, but did not work.

  1. pip install llama-cpp-python

Failed with following error log:

error: subprocess-exited-with-error
  
  Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
  exit code: 1
  
  [20 lines of output]
  *** scikit-build-core 0.8.0 using CMake 3.28.3 (wheel)
  *** Configuring CMake...
  2024-02-12 13:32:53,294 - 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\XXXX\AppData\Local\Temp\tmppvgnpols\build\CMakeInit.txt
  -- Building for: NMake Makefiles
  CMake Error at CMakeLists.txt:3 (project):
    Running
  
     'nmake' '-?'
  
    failed with:
  
     The system cannot find the file specified
  
  
  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
  [end of output]
  1. Installed and set arguments for cmake Cloned llama-cpp repo using GIT Tried to build from source

Failed with following error:

Building wheels for collected packages: llama_cpp_python
  Building editable for llama_cpp_python (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building editable for llama_cpp_python (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      *** scikit-build-core 0.8.0 using CMake 3.28.3 (editable)
      *** Configuring CMake...
      2024-02-13 16:33:17,188 - 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\XXXX\AppData\Local\Temp\tmp03k7na_j\build\CMakeInit.txt
      CMake Error: CMAKE_GENERATOR was set but the specified generator doesn't exist. Using CMake default.
      -- Building for: NMake Makefiles
      CMake Error at CMakeLists.txt:3 (project):
        Running

         'nmake' '-?'

        failed with:

         The system cannot find the file specified


      -- Configuring incomplete, errors occurred!

      *** CMake configuration failed
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building editable for llama_cpp_python
Failed to build llama_cpp_python
ERROR: Could not build wheels for llama_cpp_python, which is required to install pyproject.toml-based projects

All prerequisites to check and set before installing llama-cpp.

I want to use llama-cpp-python to run llama2 locally, integrate with langchain.

0

There are 0 answers