Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Windows11:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (llama-cpp-python) #2035

Open
@Lirsakura

Description

@Lirsakura
PS C:\Windows\system32> $env:CMAKE_GENERATOR = "MinGW Makefiles"
PS C:\Windows\system32> $env:CMAKE_ARGS = "-DGGML_OPENBLAS=on -DCMAKE_C_COMPILER=C:/w64devkit/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/w64devkit/bin/g++.exe"
PS C:\Windows\system32> pip install llama-cpp-python -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting llama-cpp-python
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/de/6d/4a20e676bdf7d9d3523be3a081bf327af958f9bdfe2a564f5cf485faeaec/llama_cpp_python-0.3.9.tar.gz (67.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: typing-extensions>=4.5.0 in d:\users\42411\anaconda3\lib\site-packages (from llama-cpp-python) (4.11.0)
Requirement already satisfied: numpy>=1.20.0 in d:\users\42411\anaconda3\lib\site-packages (from llama-cpp-python) (1.26.4)
Collecting diskcache>=5.6.1 (from llama-cpp-python)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/3f/27/4570e78fc0bf5ea0ca45eb1de3818a23787af9b390c0b0a0033a1b8236f9/diskcache-5.6.3-py3-none-any.whl (45 kB)
Requirement already satisfied: jinja2>=2.11.3 in d:\users\42411\anaconda3\lib\site-packages (from llama-cpp-python) (3.1.4)
Requirement already satisfied: MarkupSafe>=2.0 in d:\users\42411\anaconda3\lib\site-packages (from jinja2>=2.11.3->llama-cpp-python) (2.1.3)
Building wheels for collected packages: llama-cpp-python
  Building wheel for llama-cpp-python (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      *** scikit-build-core 0.11.5 using CMake 4.0.3 (wheel)
      *** Configuring CMake...
      2025-06-30 14:33:53,317 - 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\42411\AppData\Local\Temp\tmp75z2jcwv\build\CMakeInit.txt
      -- Building for: MinGW Makefiles
      CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
      -- 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 wheel for llama-cpp-python
Failed to build llama-cpp-python
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (llama-cpp-python)

I tried to install llama-cpp-python in PowerShell but it failed, but it was installed successfully in CMD. However, even if the installation is successful in the CMD environment, the CPU is used instead of the GPU when inferencing. How can I solve the problem?

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions