‘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.
相关推荐
计算机毕业编程指导师6 分钟前
基于深度学习的电子垃圾与混合材料图像分类系统实战:ResNet-50迁移学习+Django部署+三种识别入口完整方案
python·深度学习·毕业设计·resnet·课程设计·图像分类·电子垃圾
外收内放7 分钟前
FastAPI猜字谜实战(5):会话管理
开发语言·python·学习·fastapi
垆边人似月.11 分钟前
选型与快速跑通(Tesseract / EasyOCR / PaddleOCR)
前端·python
Carl_奕然22 分钟前
【智能体】Loop 的四种设计模式之:Verification Loop(2026 最新版)
人工智能·python·设计模式
茉莉玫瑰花茶31 分钟前
线性代数 [ 矩阵乘法与线性变换复合的联系 ]
python·线性代数·math
garmin Chen35 分钟前
Rag引入
python·agent·rag
小oo呆5 小时前
【学习心得】Python多线程
python
happylifetree9 小时前
Python70:核心语法-函数进阶-案例2
python
王中阳Go9 小时前
两个入口答案不一致先别调模型:6 行入口口径对账表(附脚本)
人工智能·后端·python·大语言模型·1024程序员节
BK贝壳9 小时前
bool-hybrid-array 落盘我只认 .bha:用 Create_BHA / Ask_BHA 做布尔数组序列化
数据结构·python·numpy·1024程序员节