‘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.
相关推荐
YJlio2 分钟前
杨利杰YJlio|博客导航目录(专栏总览 + 推荐阅读路线)
开发语言·python·pdf
Swizard2 分钟前
数据不够代码凑?用 Albumentations 让你的 AI 模型“看”得更广,训练快 10 倍!
python·算法·ai·训练
智算菩萨6 分钟前
【Python机器学习】决策树与随机森林:解释性与鲁棒性的平衡
python·决策树·机器学习
宁大小白6 分钟前
pythonstudy Day44
python·机器学习
羸弱的穷酸书生21 分钟前
今天跟 AI学了一手
python
不要em0啦22 分钟前
从0开始学python:声明
python
ha_lydms25 分钟前
4、Spark 函数_m/n/o/p/q/r
大数据·数据库·python·sql·spark·数据处理·dataworks
Pyeako35 分钟前
机器学习--集成学习之随机森林&贝叶斯算法
python·算法·随机森林·机器学习·集成学习·贝叶斯算法
reasonsummer37 分钟前
【人工智能-03-06】20251227 人工智能第二学期课程 下载课件《教育设计中的信息化》中的“多人编辑文件” 的图片,然后合并PDF
python
.似水1 小时前
Python面向对象
开发语言·python