[Python] WARNING - Can't find a Python library, got libdir=None, ldlibrary=None,...

Discussão em 'Python' iniciado por Stack, Fevereiro 2, 2025.

  1. Stack

    Stack Membro Participativo

    Trying to install llama-cpp-python with "pip install llama-cpp-python". It is failing with following error.

    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:\mydata\installations\ai\envs\privategpt\lib\site-packages (from llama-cpp-python) (4.8.0)
    Requirement already satisfied: numpy>=1.20.0 in c:\mydata\installations\ai\envs\privategpt\lib\site-packages (from llama-cpp-python) (1.26.0)
    Requirement already satisfied: diskcache>=5.6.1 in c:\mydata\installations\ai\envs\privategpt\lib\site-packages (from llama-cpp-python) (5.6.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
    ╰─> [644 lines of output]
    *** scikit-build-core 0.7.0 using CMake 3.27.7 (wheel)
    *** Configuring CMake...
    2023-12-01 16:56:53,129 - 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\vard~1\AppData\Local\Temp\tmpe8xr4tpk\build\CMakeInit.txt
    -- Building for: Visual Studio 15 2017
    -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22000.
    -- The C compiler identification is MSVC 19.16.27035.0
    -- The CXX compiler identification is MSVC 19.16.27035.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.37.2.windows.2")
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - not found
    -- Found Threads: TRUE
    -- CMAKE_SYSTEM_PROCESSOR: AMD64
    -- CMAKE_GENERATOR_PLATFORM: x64
    -- x86 detected
    -- Performing Test HAS_AVX_1
    -- Performing Test HAS_AVX_1 - Success
    -- Performing Test HAS_AVX2_1
    -- Performing Test HAS_AVX2_1 - Success
    -- Performing Test HAS_FMA_1
    -- Performing Test HAS_FMA_1 - Success
    -- Performing Test HAS_AVX512_1
    -- Performing Test HAS_AVX512_1 - Failed
    -- Performing Test HAS_AVX512_2
    -- Performing Test HAS_AVX512_2 - Failed
    CMake Warning (dev) at CMakeLists.txt:20 (install):
    Target llama has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
    This warning is for project developers. Use -Wno-dev to suppress it.

    CMake Warning (dev) at CMakeLists.txt:29 (install):
    Target llama has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.
    This warning is for project developers. Use -Wno-dev to suppress it.

    -- Configuring done (27.2s)
    -- Generating done (0.3s)
    -- Build files have been written to: C:/Users/vard/AppData/Local/Temp/tmpe8xr4tpk/build
    *** Building project with Visual Studio 15 2017...
    Change Dir: 'C:/Users/vard/AppData/Local/Temp/tmpe8xr4tpk/build'

    Run Build Command(s): "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin/MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration=Release /p:platform=x64 /p:VisualStudioVersion=15.0 /v:n
    Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.
    .
    .
    .
    .
    .

    *** CMake build 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


    Needed suggestions for successful installation

    Continue reading...

Compartilhe esta Página