‘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.
相关推荐
Dxy12393102165 分钟前
Python如何使用DrissionPage做自动化:简单入门指南
开发语言·python·自动化
石去皿7 分钟前
从本地知识库到“活”知识——RAG 落地全景指南
c++·python·大模型·rag
hui函数10 分钟前
Python系列Bug修复PyCharm控制台pip install报错:如何解决 pip install 网络报错 企业网关拦截 User-Agent 问题
python·pycharm·bug
a努力。13 分钟前
虾皮Java面试被问:JVM Native Memory Tracking追踪堆外内存泄漏
java·开发语言·jvm·后端·python·面试
Kratzdisteln14 分钟前
【Python】Flask
开发语言·python·flask
sa1002730 分钟前
基于Python的京东评论爬虫
开发语言·爬虫·python
Cigaretter71 小时前
Day 38 早停策略和模型权重的保存
python·深度学习·机器学习
sunywz1 小时前
【JVM】(2)java类加载机制
java·jvm·python
Silence_Jy1 小时前
GPU架构
python
kwg1261 小时前
本地搭建 OPC UA MCP 服务
python·agent·mcp