‘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.
相关推荐
烟锁池塘柳010 分钟前
【已解决】解决CondaVerificationError:PyTorch安装包损坏问题
人工智能·pytorch·python
程序员爱钓鱼22 分钟前
Python编程实战 | 函数与模块化编程 - 第三方库的安装与管理(pip使用)
后端·python·ipython
国服第二切图仔23 分钟前
Rust开发之Result枚举与?运算符简化错误传播
开发语言·python·rust
程序员爱钓鱼24 分钟前
Python编程实战 | 面向对象与进阶语法-类与对象的概念
后端·python·ipython
IT学长编程1 小时前
计算机毕业设计 基于Python的电商用户行为分析系统 Django 大数据毕业设计 Hadoop毕业设计选题【附源码+文档报告+安装调试】
大数据·hadoop·python·django·毕业设计·课程设计·电商用户行为分析系统
国服第二切图仔1 小时前
Rust开发之自定义错误类型(实现Error trait)
开发语言·python·rust
Geoking.1 小时前
PyTorch 中 Tensor 交换维度(transpose、permute、view)详解
人工智能·pytorch·python
咚咚王者1 小时前
人工智能之编程基础 Python 入门:第四章 条件循环与异常
人工智能·python
做运维的阿瑞10 小时前
用 Python 构建稳健的数据分析流水线
开发语言·python·数据分析
左师佑图10 小时前
综合案例:Python 数据处理——从Excel文件到数据分析
开发语言·python·数据分析·excel·pandas