想請問一下大家,這是我在replit上運行的,當更新完pip之後可能是因為套件還是python不相容的問題突然就出現以下錯誤訊息:
謝謝大家的解答~~
Traceback (most recent call last):
File "main.py", line 101, in <module>
asyncio.run(main())
File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-python3-3.8.12/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-python3-3.8.12/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "main.py", line 94, in main
async with bot:
AttributeError: __aexit__
* Running on all addresses (0.0.0.0)
WARNING: This is a development server. Do not use it in a production deployment.
原代碼為這樣:
async def main():
async with bot:
await load_extensions()
await bot.start(os.environ['Token'])
# 確定執行此py檔才會執行
if __name__ == "__main__":
keep_alive.keep_alive()
asyncio.run(main())