‘ProactorEventLoop‘ object has no attribute ‘_compute_internal_coro‘

问题

windows开发环境Pycharm通过loop.run_until_complete执行asyncio异步多线程时突然出现报错:

"AttributeError: 'ProactorEventLoop' object has no attribute '_compute_internal_coro'"

最开始怀疑时Python版本问题或者环境配置问题,排查了很久都没有解决问题。

解决步骤

在Google发现了是Pycharm升级到2023.3后导致的,只能回退版本或修改配置

  • 在Pycharm使用快捷键 CTRL+Shift+A
  • 输入 "Registry..."
  • 修改 python.debug.asyncio.repl 取消勾选
  • 重启

官方社区

To enable asyncio for the debugger, follow the steps:

  1. Open PyCharm
  2. Use Shift + Shift (Search Everywhere)
  3. In the popup type: and press Enter Registry
  4. Find "Registry" in the list of results and click on it.
  5. In the new popup find line and check the respective checkboxpython.debug.asyncio.repl
  6. Press Close.
  7. Restart the IDE.
  8. The asyncio support will be enabled in the debugger.
相关推荐
第一程序员3 分钟前
Python深度学习实战:从理论到应用
python·github
乐园游梦记8 分钟前
下载 Docker 镜像(CVAT)资源
人工智能·python·深度学习·yolo·机器学习·cvat
第一程序员10 分钟前
Python数据分析:Pandas vs Polars 详细对比
python·github
程序员杰哥11 分钟前
Web UI自动化测试之PO篇
自动化测试·软件测试·python·selenium·测试工具·ui·测试用例
无责任此方_修行中13 分钟前
MkDocs宫斗事件:开源项目控制权争夺与技术社区分裂
python·程序员
lagrahhn13 分钟前
python面向对象中__new__和__init__区别
后端·python·程序员
风舞雪凌月18 分钟前
【趣谈】移动系统和桌面系统编程语言思考
java·c语言·c++·python·学习·objective-c·swift
黑剑客与剑20 分钟前
一款使用ai来反编译pyc文件的工具 (支持python3.13)
人工智能·python·反编译·pyc
Thomas.Sir21 分钟前
第五章:RAG知识库开发之【利用RAG知识库实现智能AI系统:从零构建企业级智能问答应用】
人工智能·python·vue·状态模式·fastapi·智能
gc_229922 分钟前
学习python调用pymupdf库将pdf文件转换为图片的基本用法
python·pymupdf