本文参考:https://blog.51cto.com/4292565/2451307
pip install matplotlib后报错:AttributeError: module ‘sip’ has no attribute 'setapi’的解决办法:
将
import matplotlib.pyplot as plt
改为
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
把matplotlib的backend从Agg配置为TkAgg