‘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 分钟前
当多进程遇上异步:一次 Celery 与 Async SQLAlchemy 的边界冲突
分布式·后端·python·架构·fastapi
梨轻巧8 分钟前
pyside6常用控件:QCheckBox() 单个复选框、多个复选框、三态模式
python
寒秋丶13 分钟前
Milvus:集合(Collections)操作详解(三)
数据库·人工智能·python·ai·ai编程·milvus·向量数据库
寒秋丶15 分钟前
Milvus:Schema详解(四)
数据库·人工智能·python·ai·ai编程·milvus·向量数据库
梨轻巧21 分钟前
pyside6常用控件:QComboBox() 下拉菜单
python
嵌入式-老费31 分钟前
自己动手写深度学习框架(快速学习python和关联库)
开发语言·python·学习
一月是个猫1 小时前
MCP协议之天气演练
python·mcp
李辉20031 小时前
Python逻辑运算符
java·网络·python
lzptouch1 小时前
Django项目
后端·python·django
程序猿20232 小时前
Python每日一练---第三天:删除有序数组中的重复项
开发语言·python