Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based proj
创始人
2024-11-06 07:13:06

安装llama-cpp-python包时,出现下述问题:

Collecting llama-cpp-python   Using cached llama_cpp_python-0.2.28.tar.gz (9.4 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:\software\anaconda3\lib\site-packages (from llama-cpp-python) (4.8.0) Collecting diskcache>=5.6.1   Using cached diskcache-5.6.3-py3-none-any.whl (45 kB) Requirement already satisfied: numpy>=1.20.0 in d:\software\anaconda3\lib\site-packages (from llama-cpp-python) (1.23.5) 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.7.1 using CMake 3.28.1 (wheel)       *** Configuring CMake...       2024-01-15 02:55:12,546 - scikit_build_core - WARNING - Can't find a Python library, got libdir=None, ldlibrary=None, multiarch=None, masd=None       loading initial cache file C:\Windows\TEMP\tmpyjbtivnu\build\CMakeInit.txt       -- Building for: NMake Makefiles       CMake Error at CMakeLists.txt:3 (project):         Running           'nmake' '-?'          failed with:           no such file or directory         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 

根据下面的链接
https://github.com/abetlen/llama-cpp-python/issues/54

 Building windows wheels for Python 3.10 requires Microsoft Visual Studio 2022. 

所以需要新装个VisualStudio 2022 + C++ building tool再重装
去官网下载
在这里插入图片描述
必须勾选C++桌面开发(10G+),我只改了IDE(4G+)的路径。
在这里插入图片描述
安装好之后,再次输入,即可安装成功

pip install llama-cpp-python 
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/llama-cpp-python/ Collecting llama-cpp-python   Using cached llama_cpp_python-0.2.28.tar.gz (9.4 MB)   Installing build dependencies ... done   Getting requirements to build wheel ... done   Installing backend dependencies ... done   Preparing metadata (pyproject.toml) ... done Collecting diskcache>=5.6.1   Using cached diskcache-5.6.3-py3-none-any.whl (45 kB) Requirement already satisfied: numpy>=1.20.0 in d:\software\anaconda3\lib\site-packages (from llama-cpp-python) (1.23.5) Requirement already satisfied: typing-extensions>=4.5.0 in d:\software\anaconda3\lib\site-packages (from llama-cpp-python) (4.8.0) Building wheels for collected packages: llama-cpp-python   Building wheel for llama-cpp-python (pyproject.toml) ... done   Created wheel for llama-cpp-python: filename=llama_cpp_python-0.2.28-cp310-cp310-win_amd64.whl size=1906661 sha256=da0b3f2650793d7d67bdc9355c28c3c8d9ad630a2aa5c8a480f3afa21bcdd31a   Stored in directory: c:\users\dell\appdata\local\pip\cache\wheels\74\a0\5c\281bde8a2e00a36b941882b1723e70eb7ac0f773a5c50f4132 Successfully built llama-cpp-python Installing collected packages: diskcache, llama-cpp-python Successfully installed diskcache-5.6.3 llama-cpp-python-0.2.28 

在这里插入图片描述

参考:https://ceshiren.com/t/topic/27526/7

相关内容

热门资讯

裸辞做“一人公司”,我后悔了 去年这个时候,一位以色列程序员正在东南亚旅行。他顺手把一个在脑子里转了很久的想法做成了产品,一个让任...
南京建成国内首个Pre-6G试... 4月21日,2026全球6G技术与产业生态大会在南京开幕。全息互动技术展台前,一名远在北京的工作人员...
超梵求职受邀参加“2025抖音... 超梵求职受邀参加“2025抖音巨量引擎成人教育行业生态大会”,探讨分享优质内容传播,服务万千学员。 ...
摩托罗拉Razr 2026(R... IT之家 4 月 22 日消息,摩托罗拉宣布新一代 Razr 折叠手机将于 4 月 29 日在美国发...
库克卸任,特纳斯领航:苹果新纪... 苹果首席执行官蒂姆·库克将卸任,硬件工程主管约翰·特纳斯将接任,苹果公司今天宣布此事。 库克将在夏季...