When the source code Matplotlib has the following parameters for setting Chinese or negative numbers, a NameError will appear in pyinstaller packaging: name ‘defaultparams’ is not defined error
plt.rcParams['font.sans-serif'] = ['STSong']
plt.rcParams['axes.unicode_minus'] = False
Solution:
Reduce Matplotlib to version 3.2.2
conda install matplotlib==3.2.2
Note: pyinstaller 3.6 version Python 3.6.13 version