Process finished with exit code -1066598274 (0xC06D007E)

时间:2025-05-08 09:10:14

Process finished with exit code -1066598274 (0xC06D007E)

一、问题描述

在使用matplotlib生成和保存图片时,图片一闪而过且不能正常生成和保存,报Process finished with exit code -1066598274 (0xC06D007E)直接退出。

二、原因分析

开始以为是matplotlib库的backend的问题,参考网上的方法使用(‘TkAgg’)但是仍然没有解决。后来经过搜索Process finished with exit code -1066598274 (0xC06D007E)参照博文才发现是matplotlib和numpy版本冲突的问题。

三、解决方法

1、全部卸载

pip uninstall matplotlib
pip uninstall numpy

2、查看是否卸载干净

pip list

发现列表中还存在matplotlib-inline和numpy以及对应dist-info文件(链接文件,用来导入包)。
3、进入anaconda/lib/site-packages删除掉上述文件。
4、重新pip install matplotlib,此时会附带安装不冲突的numpy版本。
然后matplotlib库可以正常使用。