llama-cpp-python安装bug:error: subprocess-exited-。scikit-build-core 0.8.2 using CMake 3.28.3 (wheel)

llama-cpp-python安装bug:error: subprocess-exited-。scikit-build-core 0.8.2 using CMake 3.28.3 (wheel)

    正在检查是否收录...
一言准备中...

llama-cpp-python安装bug:error: subprocess-exited-。scikit-build-core 0.8.2 using CMake 3.28.3 (wheel)

环境

系统 linux python 3.10 llama_cpp_python==0.2.55 

1 Bug详情

# 导致安装错误的命令 pip install 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 ╰─> [325 lines of output] *** scikit-build-core 0.8.2 using CMake 3.28.3 (wheel) *** Configuring CMake... 2024-03-04 17:29:03,943 - scikit_build_core - WARNING - libdir/ldlibrary: /home/zmp/.conda/envs/base_torch_201cu118_cp310/lib/libpython3.10.a is not a real file! 2024-03-04 17:29:03,943 - scikit_build_core - WARNING - Can't find a Python library, got libdir=/home/zmp/.conda/envs/base_torch_201cu118_cp310/lib, ldlibrary=libpython3.10.a, multiarch=x86_64-linux-gnu, masd=None loading initial cache file /tmp/tmpcjlys8ws/build/CMakeInit.txt -- The C compiler identification is GNU 4.8.5 -- The CXX compiler identification is GNU 4.8.5 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - 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: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Git: /usr/bin/git (found version "1.8.3.1") -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes -- Found Threads: TRUE -- Warning: ccache not found - consider installing it for faster compilation or disable this warning with LLAMA_CCACHE=OFF -- CMAKE_SYSTEM_PROCESSOR: x86_64 -- x86 detected CMake Warning (dev) at CMakeLists.txt:21 (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:30 (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 (1.1s) -- Generating done (0.0s) -- Build files have been written to: /tmp/tmpcjlys8ws/build *** Building project with Ninja... Change Dir: '/tmp/tmpcjlys8ws/build' ...... /tmp/pip-install-qpsadbts/llama-cpp-python_6fb3cbcdc9d540c5b4fb53a5f6f8cd97/vendor/llama.cpp/ggml-quants.c:9656:13: 错误:隐式声明函数‘_mm256_set_m128i’ [-Werror=implicit-function-declaration] const __m256i full_signs_1 = _mm256_set_m128i(full_signs_l, full_signs_l); ^ /tmp/pip-install-qpsadbts/llama-cpp-python_6fb3cbcdc9d540c5b4fb53a5f6f8cd97/vendor/llama.cpp/ggml-quants.c:9656:42: 错误:用‘int’初始化‘__m256i’时类型不兼容 const __m256i full_signs_1 = _mm256_set_m128i(full_signs_l, full_signs_l); ^ /tmp/pip-install-qpsadbts/llama-cpp-python_6fb3cbcdc9d540c5b4fb53a5f6f8cd97/vendor/llama.cpp/ggml-quants.c:9657:42: 错误:用‘int’初始化‘__m256i’时类型不兼容 const __m256i full_signs_2 = _mm256_set_m128i(full_signs_h, full_signs_h); ....... ninja: build stopped: subcommand failed. *** 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 

错误原因:使用pip install llama-cpp-python安装时,是通过下载源码编译安装的(llama_cpp_python-0.2.55.tar.gz (36.8 MB))。这时候如果系统没有相应的cmake 和 gcc版本,会弹出这个错误。

2 解决方案

根据系统选择官方编译后的whl下载进行离线安装。

官方网址
Releases · abetlen/llama-cpp-python (github.com)

安装命令例子

pip install llama_cpp_python-0.2.55-cp310-cp310-manylinux_2_17_x86_64.whl 

注:官方只是编译了常见的系统,特殊系统还是需要自行编译。

一般不推荐更新公用linux系统的cmake和gcc进行安装,可以通过建立docker镜像,安装相应版本的cmake和gcc(gcc应高于11.0.0,可以为11.3.0)。查看gcc版本:gcc --version

llamapythonlinuxpsagitidedbtbtstpu2024elostemgithubcodethreadsdocdockeretl解决方案
  • 本文作者:WAP站长网
  • 本文链接: https://wapzz.net/post-16148.html
  • 版权声明:本博客所有文章除特别声明外,均默认采用 CC BY-NC-SA 4.0 许可协议。
本站部分内容来源于网络转载,仅供学习交流使用。如涉及版权问题,请及时联系我们,我们将第一时间处理。
文章很赞!支持一下吧 还没有人为TA充电
为TA充电
还没有人为TA充电
0
  • 支付宝打赏
    支付宝扫一扫
  • 微信打赏
    微信扫一扫
感谢支持
文章很赞!支持一下吧
关于作者
2.7W+
9
1
2
WAP站长官方

AI写作VS人类创作:五大对比揭秘

上一篇

在本地跑一个AI模型(5) - Stable Diffusion

下一篇
  • 复制图片
按住ctrl可打开默认菜单