You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

开发WaveLink音乐机器人时出现无法从discord导入Enum的错误求解

问题原因及解决办法

出现这个错误大概率是discord.py版本与WaveLink不兼容导致的:

  • 若你安装的是旧版discord.py(v1.x及以下),它的顶级discord模块未直接暴露Enum类,而WaveLink新版本需要从这里导入,因此触发报错。
  • 反之,若discord.py版本过新,WaveLink尚未适配最新模块结构,也可能出现这类导入问题。

解决步骤:

  1. 先查看当前discord.py版本:
    pip show discord.py
    
  2. 升级到WaveLink兼容的discord.py版本(WaveLink v3+通常要求discord.py v2.0及以上):
    pip install -U discord.py
    
  3. 若升级后仍报错,说明新版本discord.py与WaveLink不兼容,可指定安装稳定兼容的版本,比如:
    pip install discord.py==2.3.2
    

你也可以对照WaveLink的官方说明,确认它要求的discord.py最低版本后再安装对应版本。

内容的提问来源于stack exchange,提问作者Vinality

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 08:05:29