‘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.
相关推荐
cui_ruicheng1 小时前
Python从入门到实战(十三):模块、包与环境管理
开发语言·python
李宸净2 小时前
Web自动化测试selenium+python
前端·python·selenium
而后笑面对2 小时前
生信bwa算法
python
至乐活着3 小时前
深入Python内存管理与垃圾回收:从引用计数到分代回收的实战解析
python·性能优化·内存管理·垃圾回收·引用计数
m0_547486664 小时前
《Python数据分析与挖掘》全套PPT课件
python·数据挖掘·数据分析
㱘郳4 小时前
飞机大战Pygame存档
python·pygame
阿童木写作5 小时前
跨马翻译:一站式图片视频智能处理,提升跨境电商工作效率
人工智能·python·音视频
Python图像识别-15 小时前
基于yolov8的钢铁缺陷检测系统-2027毕业版(UI界面+Python项目源码+模型+标注好的数据集)
开发语言·python·yolo
aqi005 小时前
15天学会AI应用开发(十五)使用LangChain封装AI执行链
人工智能·python·大模型·ai编程·ai应用