‘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.
相关推荐
金銀銅鐵16 小时前
[Python] 扩展欧几里得算法
python·数学·算法
Duckdblab16 小时前
DuckDB 性能调优终极指南:打造闪电般的分析体验
python
带派擂总16 小时前
Python全栈开发精华版最全合集(包含各种面试题) Day24_异常和错误
python
金銀銅鐵19 小时前
n^5 和 n 的个位数是否总相等?
python·数学
aqi001 天前
15天学会AI应用开发(九)利用Chroma持久化向量数据
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵1 天前
借助 Pygame 探索最大公约数的规律
python·数学·游戏
ServBay2 天前
9 个 Python 第三方库推荐,不用 AI 都好像多出一个团队
后端·python
用户8356290780512 天前
如何使用 Python 添加和管理 Excel 批注(完整示例)
后端·python
用户8356290780512 天前
使用 Python 管理 Excel 工作表:创建、复制、删除与重命名
后端·python