‘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.
相关推荐
Stream_Silver8 分钟前
【Agent学习笔记3:使用Python开发简单MCP服务】
笔记·python
穿过锁扣的风13 分钟前
零基础入门 Python 爬虫:从基础到实战,爬取虎扑 / 豆瓣 / 图片全掌握
开发语言·爬虫·python
Stream_Silver17 分钟前
【Agent学习笔记2:深入理解Function Calling技术:从原理到实践】
笔记·python
love530love36 分钟前
技术复盘:llama-cpp-python CUDA 编译实战 (Windows)
人工智能·windows·python·llama·aitechlab·cpp-python·cuda版本
逄逄不是胖胖1 小时前
《动手学深度学习》-60translate实现
人工智能·python·深度学习
橘颂TA1 小时前
【测试】自动化测试函数介绍——web 测试
python·功能测试·selenium·测试工具·dubbo
爱学习的阿磊1 小时前
Python上下文管理器(with语句)的原理与实践
jvm·数据库·python
m0_736919102 小时前
Python面向对象编程(OOP)终极指南
jvm·数据库·python
one____dream2 小时前
【网安】Reverse-非常规题目
linux·python·安全·网络安全·ctf
冷雨夜中漫步2 小时前
python反转列表reverse()和[::-1]哪个效率更高
开发语言·python