安装discord.py时遇aiohttp等依赖wheel构建失败,已尝试方案仍未解决
安装discord.py时依赖编译失败的问题处理
问题详情
开发Discord机器人过程中,执行discord.py安装命令时出现以下错误:
[end of output]note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for yarl
Failed to build aiohttp frozenlist multidict yarl
ERROR: Could not build wheels for aiohttp, frozenlist, multidict, yarl, which is required to install pyproject.toml-based projects
PS C:\Users\User>
已尝试过针对该类错误的常规解决方案,但问题依旧存在。
可尝试的解决方法
- 安装预编译wheel包
找到对应Python版本和系统架构的aiohttp、frozenlist、multidict、yarl预编译.whl文件,先通过pip install 文件名.whl依次安装这些包,再执行discord.py的安装命令。 - 更新pip、wheel和setuptools到最新版本
python -m pip install --upgrade pip wheel setuptools - 配置C编译环境
安装Visual Studio Build Tools并勾选“桌面开发使用C”组件,完成安装后重新尝试安装discord.py。
内容的提问来源于stack exchange,提问作者Anonymous User
相关产品推荐
相关产品推荐

