python3.7程序打包时提示matplotlib错误

使用python3.7编写好的.py程序,在自己本地可以正常执行
想打包成.EXE可执行文件时
使用 pyinstaller -F -w plotREZv1.01.py 命令执行
最后报错
\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\hooks\hook-matplotlib.py", line 17, in
assert mpl_data_dir, "Failed to determine matplotlib's data directory!"
AssertionError: Failed to determine matplotlib's data directory!
该怎么解决呢

换一下版本试试:https://stackoverflow.com/questions/67345287/matplotlib-directory-not-found-while-using-pyinstaller-to-create-exe-from-py-fil

是不是有中文路径,或者是版本不对,网上有说先把这个matplotlib卸载了打包 之后再装