scikit-build-core
scikit-build-core copied to clipboard
I had an issue of CMake configuration failed
(privateGPT) C:\Users\AJAY\Desktop\PrivateGpt>$env:CMAKE_ARGS = "-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS"
The filename, directory name, or volume label syntax is incorrect.
(privateGPT) C:\Users\AJAY\Desktop\PrivateGpt>pip install llama-cpp-python
Collecting llama-cpp-python
Using cached llama_cpp_python-0.2.20.tar.gz (8.7 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 c:\users\ajay\anaconda3\envs\privategpt\lib\site-packages (from llama-cpp-python) (4.8.0)
Requirement already satisfied: numpy>=1.20.0 in c:\users\ajay\anaconda3\envs\privategpt\lib\site-packages (from llama-cpp-python) (1.26.0)
Collecting diskcache>=5.6.1 (from llama-cpp-python)
Using cached diskcache-5.6.3-py3-none-any.whl.metadata (20 kB)
Using cached diskcache-5.6.3-py3-none-any.whl (45 kB)
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
╰─> [20 lines of output]
*** scikit-build-core 0.6.1 using CMake 3.27.7 (wheel)
*** Configuring CMake...
2023-11-30 18:40:30,114 - 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\AJAY\AppData\Local\Temp\tmpkh6aqsh2\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]
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: Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based projects
Originally posted by @ajay9438 in https://github.com/scikit-build/scikit-build-core/issues/374#issuecomment-1833780183
Do you have MSVC inslalled? It looks like you don’t have nmake, which I think means you don’t have a compiler.
@henryiii Yes i have installed MSVC and I have installed MinGW.
Then you probably need to run in the MSVC terminal, or source the MSVC activation script before building. See https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170. CMake does try to find your MSVC install by looking at the registry, but it seems like it's not able to find it. It might not be a bad idea to add the CMake component if it's not already installed (https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170), but scikit-build-core is able to request a copy of CMake from PyPI if one isn't present.
(I'm not an expert on Windows setup, @thewtex or @jcfr might know more). I don't think there's something we are missing that would make it easier on our end, but not sure of that.
Hi @ajay9438 , looking at your screenshot, I see the MS Visual C++ Redistributables and MS Visual Studio Code, but I do not see MS Visual Studio (yes, the names can be confusing). You will want to download and install the Microsoft Visual Studio Community Edition and enable C++ support in the installer.