‘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.
相关推荐
ZTLJQ2 小时前
数据的基石:Python中关系型数据库完全解析
开发语言·数据库·python
FreakStudio3 小时前
lvgl-micropython、lv_micropython和lv_binding_micropython到底啥关系?一文读懂
python·单片机·嵌入式·面向对象·电子diy
小江的记录本3 小时前
【Redis】Redis全方位知识体系(附《Redis常用命令速查表(完整版)》)
java·数据库·redis·后端·python·spring·缓存
dinl_vin3 小时前
Python 数据分析入门系列(一):从NumPy开始
python·数据分析·numpy
小陈工4 小时前
2026年3月26日技术资讯洞察:WebAssembly崛起、AI代码质量危机与开源安全新挑战
人工智能·python·安全·架构·开源·fastapi·wasm
2401_879693874 小时前
数据分析与科学计算
jvm·数据库·python
明月_清风4 小时前
宿命的对决:深度对比 JavaScript 与 Python 的异步进化论
后端·python
明月_清风4 小时前
别再纠结 Conda 了!2026 年,uv 才是 Python 环境管理的唯一真神
后端·python
Thomas.Sir5 小时前
第一章:Python3 基础入门:从零基础到实战精通
python·ai
telllong5 小时前
BeeWare:Python原生移动应用开发
开发语言·python