错误:无法为需要安装pyproject.toml项目的spacy构建轮子。

4

enter image description here

大家好,我正在尝试安装spacy模型==2.3.5但是出现了这个错误,请帮助我!
3个回答

5

建议改用 Python 3.6-3.9 版本,因为这些版本已经提供了二进制 wheel 可以直接通过 pip install 安装,无需手动编译源代码。

(Python 3.10 与一些在源代码包中生成的 .cpp 文件存在冲突。此版本发布时,Python 3.10 尚未发布。)


它不起作用,伙计。 - Aravind R

3

在执行pip install -r requirements.txt安装模块时,我遇到了类似的错误:

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

对应修复问题的链接:

注意:请勿删除任何HTML标签。

1

尝试使用:

!pip install spacy==2.3.5

不要在 == 2.3.5 之间加空格

如果您在等号和版本之间添加任何空格,可能会出现错误。


抱歉,我没有在中间留任何空格,这里有一个打字错误 - 抱歉。 - Aravind R
使用上述命令在MacBook Air Intel OS 10.13.1 High Sierra上运行(我有理由坚持)Python 3.6.4时,安装2.3.5时出现了问题,出现了一堆红色的编译消息,但然后显示:正在下载thinc-7.4.5-cp36-cp36m-macosx_10_9_x86_64.whl(987 kB),现在导入spacy可以工作了。澄清一下,不带版本的pip install spacy无法完成。最新的spacy 3.7不再支持Python 3.6。 - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接