尝试使用 python 3.6-3.9,其中有二进制轮可供
pip install
使用,而不必从源代码编译。
(这个和python 3.10以及源码包中生成的一些
.cpp
文件有冲突,这个版本发布时Python 3.10还没有发布。)
我在执行
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
修复相应问题的链接:
尝试使用:
!pip install spacy==2.3.5
==
和 2.3.5
之间不要留有空格
如果等号和版本之间有空格,可能会出错。