‘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.
相关推荐
老徐聊GEO3 分钟前
芜湖Ai搜索获客亲测有效案例分享
人工智能·python
叫我:松哥8 分钟前
基于机器学习和flask的体育健身风险智能分析系统,系统集成DeepSeek、聚类算法、分类算法等,准确率达90%
人工智能·python·神经网络·算法·机器学习·flask·聚类
码云骑士9 分钟前
03-Python可变对象与不可变对象(下)-深浅拷贝的底层真相
开发语言·python
与代码不die不休9 分钟前
RTX5060显卡torch和torch_radon库安装避坑指南(仅linux系统)
linux·图像处理·python·深度学习
砍材农夫9 分钟前
python环境|pip|uv|venv|Conda区别
后端·python·conda·pip·uv
向量引擎10 分钟前
AI API 正在进入“请求生命周期治理”阶段:从模型迁移、Agent 接入到成本与安全排错的工程化方法
java·人工智能·python·aigc·ai编程·ai写作·gpu算力
梦想不只是梦与想12 分钟前
Python 中的线程(Thread)
python·线程·thread
热心不起来的市民小周14 分钟前
100种动物语义分割数据集(A100-Seg)
python·深度学习·计算机视觉
DrMaker16 分钟前
【无标题】
软件测试·python·测试工具·pyqt
MATLAB代码顾问16 分钟前
Python数据分析项目实战:销售数据仪表盘
开发语言·python·数据分析