‘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.
相关推荐
databook1 分钟前
如何对稀疏数据的场景进行分析
python·数据挖掘·数据分析
Java&Develop1 小时前
DeltaFStation 宝塔 Linux 部署教程
python
小柯南敲键盘1 小时前
跨境电商图片翻译工具推荐:批量AI翻译+视频字幕+智能抠图
人工智能·python·音视频
北斗落凡尘1 小时前
LangGraph 入门实战(8)--绑定工具
python·langchain
ningmengjing_2 小时前
MCP 通讯方式与实现指南
python·agent·mcp
淼澄研学2 小时前
Kimi API黑产倒卖技术解析与Python合规接入指南
开发语言·网络·python
何以解忧,唯有..2 小时前
Python 元组(tuple)详解:使用、遍历与排序
开发语言·python
KANGBboy2 小时前
Python eval安全隐患
开发语言·python
evans在进步3 小时前
LeetCode 394:字符串解码——Java 单栈模拟与嵌套解析详解
java·python·leetcode
淼澄研学3 小时前
Python结合大模型挖掘搜题长尾关键词实操指南
开发语言·python