错误:无法为 spacy 构建轮子,这是安装基于 pyproject.toml 的项目所必需的

问题描述 投票:0回答:3

大家好,我正在尝试安装 spacy model == 2.3.5 但我收到此错误,请帮助我!

python python-3.x nlp spacy
3个回答
5
投票

尝试使用 python 3.6-3.9,其中有二进制轮可供

pip install
使用,而不必从源代码编译。

(这个和python 3.10以及源码包中生成的一些

.cpp
文件有冲突,这个版本发布时Python 3.10还没有发布。)


3
投票

我在执行

pip install -r requirements.txt
时遇到了类似的错误,但对于
aiohttp
模块:

socket.c -o build/temp.linux-armv8l-cpython-311/aiohttp/_websocket.o
aiohttp/_websocket.c:198:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"                                   
          ^~~~~~~                        1 error generated.
error: command '/data/data/com.termux/files/usr/bin/arm-linux-androideabi-clang' 
failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for aiohttp
Failed to build aiohttp
ERROR: Could not build wheels for aiohttp, which is required to install
pyproject.toml-based projects

以防万一,我将在这里留下我的错误的解决方案。此错误特定于 Python

3.11
版本。在 Python 上,
3.10.6
版本安装顺利。

为了解决这个问题,我需要更新

requirements.txt

Python 模块的不工作版本

3.11
:

aiohttp==3.8.1
yarl==1.4.2
frozenlist==1.3.0

工作版本:

aiohttp==3.8.2
yarl==1.8.1
frozenlist==1.3.1

修复相应问题的链接:


1
投票

尝试使用:

!pip install spacy==2.3.5

==
2.3.5

之间不要留有空格

如果等号和版本之间有空格,可能会出错。

© www.soinside.com 2019 - 2024. All rights reserved.