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

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

Python版本:3.11

通过

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
版本安装顺利。

相关问题:yarl/_quoting.c:196:12:致命错误:'longintrepr.h'文件未找到 - 生成 1 个错误

python linux pip aiohttp termux
4个回答
15
投票

此错误的解决方案:需要更新

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

修复相应问题的链接:


4
投票

如果您像我一样在将aiohttp版本降级到3.8.1时遇到一些问题,您可以采用其他方法。

  • alpaca_trade_api-2.3.0-py3-none-any.whl

    手动下载.whl文件
  • 然后用7-zip打开.whl文件。

  • 前往alpaca_trade_api-2.3.0.dist-info\METADATA

  • 打开此文件进行编辑并更改第 21 行的要求

    来自:

       Requires-Dist: aiohttp (==3.8.1)
    

    至:

       Requires-Dist: aiohttp (==3.8.4)
    
  • 保存此更改。

  • 转到终端并手动安装此轮子

     python -pip instal (file_location)/alpaca_trade_api-2.3.0-py3-none-any.whl 
    

对我来说效果很好。


1
投票

这对我有用

pip install aiohttp==3.8.2 yarl==1.8.1 freezelist==1.3.1 打字扩展

pip install github==1.2.7 --无依赖项

0
投票

使用 python 版本 3.11 而不是 3.12

这些包 yarl==1.9.2 freezelist==1.3.3 aiohttp==3.8.4 由于某种原因与 Python 3.12 不兼容或尚不兼容。

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