‘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.
相关推荐
周杰伦fans1 小时前
pycharm之gitignore设置
开发语言·python·pycharm
weixin_462446231 小时前
【原创实践】python 获取节假日列表 并保存为excel
数据库·python·excel
计算机毕设匠心工作室2 小时前
【python大数据毕设实战】全球大学排名数据可视化分析系统、Hadoop、计算机毕业设计、包括数据爬取、数据分析、数据可视化、机器学习、实战教学
后端·python·mysql
别叫我->学废了->lol在线等2 小时前
演示 hasattr 和 ** 解包操作符
开发语言·前端·python
free-elcmacom2 小时前
机器学习入门<6>BP神经网络揭秘:从自行车摔跤到吃一堑长一智的AI智慧
人工智能·python·深度学习·神经网络·机器学习
Hi202402172 小时前
如何录制浏览器播放的音频?虚拟音频线与Python采集步骤
python·音视频
programer_333 小时前
本地手动创建一个MCP(windows环境)
windows·python·ai·mcp·cherry studio
电饭叔4 小时前
不含Luhn算法《python语言程序设计》2018版--第8章14题利用字符串输入作为一个信用卡号之二(识别卡号有效)
java·python·算法
观音山保我别报错4 小时前
列表,元组,字典
开发语言·python
小付爱coding5 小时前
Claude Code安装教程【windows版本】
java·git·python