‘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.
相关推荐
Lvan的前端笔记28 分钟前
python:深入理解 Python 的 `__name__ == “__main__“` 与双下划线(dunder)机制
开发语言·python
爱笑的眼睛111 小时前
深入解析Matplotlib Axes API:构建复杂可视化架构的核心
java·人工智能·python·ai
爱埋珊瑚海~~1 小时前
基于MediaCrawler爬取热点视频
大数据·python
工程师丶佛爷1 小时前
从零到一MCP集成:让模型实现从“想法”到“实践”的跃迁
大数据·人工智能·python
2501_921649491 小时前
免费获取股票历史行情与分时K线数据 API
开发语言·后端·python·金融·数据分析
高洁012 小时前
DNN案例一步步构建深层神经网络(二)
人工智能·python·深度学习·算法·机器学习
Insight.2 小时前
背包问题——01背包、完全背包、多重背包、分组背包(Python)
开发语言·python
Lucky高2 小时前
Pandas库实践1_预备知识准备
python·pandas
Salt_07283 小时前
DAY 36 官方文档的阅读
python·算法·机器学习·github
k***92163 小时前
Python 科学计算有哪些提高运算速度的技巧
开发语言·python