‘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.
相关推荐
2601_9609067214 分钟前
科技“无人区”跋涉,难度高、不确定性大
windows·macos·pycharm·myeclipse
巨量HTTP1 小时前
Python爬虫动态换IP实战,彻底解决IP403封禁、限流问题(附完整代码)
爬虫·python·tcp/ip·http
晓子文集2 小时前
Tushare接口文档:指数成分和权重(index_weight)
大数据·数据库·python·金融·量化投资
小大宇2 小时前
python pandas dataFrame sqlAlchemy案例
python·pandas
淼澄研学2 小时前
Python进阶实战:深入解析推导式与生成器等5大核心特性
开发语言·python
xlrqx2 小时前
商丘家电清洗培训零基础学习需掌握哪些要点零基础到底能不能学
python·学习
卷无止境2 小时前
Python虚拟环境江湖:从venv到uv,如何避开依赖冲突的坑
后端·python
玉鸯3 小时前
Agent Harness 工程核心架构拆解与 300 行代码实现
python·agent
米码收割机3 小时前
【Python】Django 电子设备商城系统(源码+说明文档)[独一无二]
开发语言·python·django
互联网中的一颗神经元3 小时前
小白python入门 - 38. 动态内容:接口优先与自动化扫盲
开发语言·python·自动化