‘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.
相关推荐
诸神缄默不语9 小时前
如何用Python处理文件:Word导出PDF & 如何用Python从Word中提取数据:以处理简历为例
python·pdf·word
vvoennvv10 小时前
【Python TensorFlow】 TCN-LSTM时间序列卷积长短期记忆神经网络时序预测算法(附代码)
python·神经网络·机器学习·tensorflow·lstm·tcn
nix.gnehc10 小时前
PyTorch
人工智能·pytorch·python
z***33510 小时前
SQL Server2022版+SSMS安装教程(保姆级)
后端·python·flask
I'm Jie11 小时前
从零开始学习 TOML,配置文件的新选择
python·properties·yaml·toml
二川bro11 小时前
Scikit-learn全流程指南:Python机器学习项目实战
python·机器学习·scikit-learn
代码的乐趣11 小时前
支持selenium的chrome driver更新到142.0.7444.175
chrome·python·selenium
数据知道12 小时前
Django基础项目:从零到一搭建用户管理系统
python·django·python web·python项目
z樾12 小时前
TorchRL-MADDPG
pytorch·python·深度学习