‘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.
相关推荐
勇往直前plus43 分钟前
深入理解 Python 内存模型:模块、类、对象的存储与运行机制
开发语言·python
yunhuibin1 小时前
NIN网络学习
人工智能·python·深度学习·神经网络·学习
派大星-?1 小时前
自动化测试五模块一框架(下)
开发语言·python
两万五千个小时2 小时前
构建mini Claude Code:02 - 把 Bash 拆成专用工具(read_file, write_file 等)
人工智能·python
henry1010102 小时前
Ansible自动化运维全攻略(AI生成)
linux·运维·python·ansible·devops
weixin_440401693 小时前
Python数据分析(空值、重复值检测删除与设置)
开发语言·python·数据分析
家的尚尚签4 小时前
高定木作企业实践:案例分享与成果展示
大数据·人工智能·python
haosend5 小时前
极简小白Python教程-实现能基本看懂和简单编写代码
python·路由器·交换机·网络自动化
码农小韩5 小时前
AIAgent应用开发——大模型理论基础与应用(六)
人工智能·python·提示词工程·aiagent·deepseek