源代码matplotlib有如下设置中文或负数的参数时,pyinstaller 打包会出现NameError: name ‘defaultParams‘ is not defined错误
plt.rcParams['font.sans-serif'] = ['STSong'] # 用来正常显示中文字符
plt.rcParams['axes.unicode_minus'] = False # 正常显示负号
解决方法:
降低matplotlib到3.2.2版本
conda install matplotlib==3.2.2
注:pyinstaller 3.6版本,Python 3.6.13版本
参考:https://stackoverflow.com/questions/63163027/how-to-use-pyinstaller-with-matplotlib-in-use