‘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.
相关推荐
毋语天13 小时前
Python 模块、包与异常处理:构建更稳健的程序
开发语言·python
阿kun要赚马内13 小时前
Python多进程中的数据隔离
python
才兄说13 小时前
机器人二次开发机器狗巡检?低耗电自主绕行
python
-SOLO-14 小时前
Python 爬取小红书 文章标题和内容 仅供学习
android·python·学习
小陈工14 小时前
Python异步编程进阶:asyncio高级模式与性能调优
开发语言·前端·数据库·人工智能·python·flask·numpy
是有头发的程序猿14 小时前
竞品店铺拆解:1688店铺首页装修数据API Python实战教程
开发语言·python
Ricardo-Yang14 小时前
使用GEE以及LandSat8植被指数NDVI计算
python·深度学习·神经网络·算法·视觉检测
Derrick__115 小时前
LangChain基础实战手记:如何给大模型装上“大脑(记忆)”和“双手(工具)”?
人工智能·python·langchain·个人开发
tangjunjun-owen15 小时前
[特殊字符] Python异步调用本地Ollama大模型实战:从Demo到高并发避坑指南
开发语言·chrome·python
RSTJ_162515 小时前
PYTHON+AI LLM DAY FOURTY-THREE
开发语言·人工智能·python