‘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.
相关推荐
不易思不逸10 分钟前
SAM2 测试
人工智能·python
趣知岛1 小时前
智能家居与物联网项目实战全指南:从架构设计到落地部署
python·物联网·智能家居
龘龍龙2 小时前
Python基础(八)
开发语言·python
vibag3 小时前
FastAPI框架
python·pycharm·fastapi
站大爷IP3 小时前
从零开始用Python生成码:自定义样式与Logo嵌入
python
天才测试猿3 小时前
2026全新软件测试面试八股文【含答案+文档】
自动化测试·软件测试·python·功能测试·测试工具·面试·职场和发展
TonyLee0173 小时前
python深拷贝与浅拷贝机制
python
用户8356290780513 小时前
如何将 Python 列表高效导出为 Excel 文件
后端·python
安娜的信息安全说4 小时前
LangGraph:构建智能工作流的新方式
python·ai·langgraph
爱吃泡芙的小白白4 小时前
如何在现有配置好环境的Pycharm中安装jupyterlab这个工具
ide·python·pycharm·notebook·虚拟环境·jupyterlab