‘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.
相关推荐
人机(未转人工)2 小时前
python 批量测试ip是否能ping( 多线程 )
python
cndes2 小时前
安装Miniconda+Jupyter notebook
ide·python·jupyter
Patrick在香港3 小时前
Python 拉取城巴开放数据:406 条路线,香港岛巴士网络的数字画像
网络·python·数据分析·php·数据可视化·香港·开放数据
for_ever_love__3 小时前
python基础语法学习: 正则表达式
python·学习·正则表达式
aiqianji3 小时前
功能全面的教AI短篇小说写作的软件都有哪些?
人工智能·python
轮到我狗叫了3 小时前
Slurm如何使用
人工智能·python·深度学习·机器学习
Ali885204 小时前
Python列表增删改查速查表和详细演示
python
新时代牛马4 小时前
softirq 与tasklet:从irq_exit 到__do_softirq 的下半部路径
python
tqs_123454 小时前
值传递与引用传递
java·开发语言·python
YsyaaabB4 小时前
Deep Agents 实战课程
python·langchain