解决办法参考:https://www.cnblogs.com/QiKa/p/14457269.html 今天逛 Gitee ,克隆了一些开源的 Pytest 代码到本地研究,在 PyCharm 中一键添加、更新了很多第三方插件,导致我之前完美运行的代码突然报了如下所示的错误信息: ModuleNotFoundError: No module named '_pytest.resultlog' 分析原因: 因为安装了 pytest-rerunfailures(这个插件是失败重跑插件) 然后导致 _pytest.resultlog 该模块被删除 解决办法: 卸载 pytest-rerunfailures 使用 pytest-reportlog 代替