AttributeError 模块“asyncio.coroutines”没有属性“_DEBUG”错误

AttributeError Module 'asyncio.coroutines' has no attribute '_DEBUG' Error

提问人:HardNinjaGreator Dev 提问时间:11/17/2023 最后编辑:Brian Tompsett - 汤莱恩HardNinjaGreator Dev 更新时间:11/17/2023 访问量:16

问:

我最近想创建一个 discord 机器人,它获取彩虹六号围攻游戏中玩家的统计数据并显示它们,我发现了一个 API,其中包含有关如何使用它的纪录片,并且似乎它使用了 python 3.7

我尝试执行的代码是以下代码:

import asyncio
import r6statsapi

loop = asyncio.get_event_loop()

client = r6statsapi.Client("TOKEN")
players = loop.run_until_complete(
    client.get_generic_stats('NotASm8rf.-', r6statsAPI.Platform.uplay)
)

每次我尝试运行此代码时,我都会收到此错误:

Traceback (most recent call last):
  File "E:\R6S Greece Bot\test.py", line 2, in <module>
    import r6statsapi
  File "C:\Users\win\AppData\Local\Programs\Python\Python312\Lib\site-packages\r6statsapi\__init__.py", line 1, in <module>
    from .client import Client as Client
  File "C:\Users\win\AppData\Local\Programs\Python\Python312\Lib\site-packages\r6statsapi\client.py", line 4, in <module>
    import aiohttp
  File "C:\Users\win\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiohttp\__init__.py", line 6, in <module>
    from .client import BaseConnector as BaseConnector
  File "C:\Users\win\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiohttp\client.py", line 32, in <module>
    from . import hdrs, http, payload
  File "C:\Users\win\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiohttp\http.py", line 7, in <module>
    from .http_parser import HeadersParser as HeadersParser
  File "C:\Users\win\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiohttp\http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext
  File "C:\Users\win\AppData\Local\Programs\Python\Python312\Lib\site-packages\aiohttp\helpers.py", line 100, in <module>
    old_debug = coroutines._DEBUG  # type: ignore
AttributeError: module 'asyncio.coroutines' has no attribute '_DEBUG'

我尝试搜索,但找不到任何东西,有什么帮助吗?

我尝试在网上搜索,但在这里找不到东西。

Python 错误处理 Discord discord.py

评论


答: 暂无答案