‘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.
相关推荐
熹乐互动2 小时前
电子签约软件实践分享:亲测哪家定制效果好
大数据·人工智能·python
love_summer2 小时前
深入理解Python基础:数据类型、运算符与内存机制初探
python
小雪_Snow2 小时前
Python 安装教程【使用 Python install manager】
python
星月前端2 小时前
基于DeepSeek API的Telegram机器人
python·机器人
唐叔在学习2 小时前
才知道python还可以这样发消息提醒的
后端·python·程序员
天天睡大觉2 小时前
Python学习1
开发语言·python·学习
Johny_Zhao2 小时前
黑客msfconsole渗透工具超详细使用说明
linux·python·网络安全·信息安全·渗透测试·云计算·系统运维·攻防演练
luoluoal2 小时前
基于python的旅游景点方面级别情感分析语料库与模型(源码+文档)
python·mysql·django·毕业设计·源码
directx3d_beginner2 小时前
ifcconvert转换ifc为Obj
开发语言·python
滴啦嘟啦哒2 小时前
【机械臂】【视觉】一、加入摄像机并实现世界坐标与像素坐标的互相转换
python·深度学习·vla