pyinstaller打包文件出现matplotlib相关报错AssertionError: Failed to determine matplotlib's data directory!的解决方法
pyinstaller打包文件出现出现如下报错

方法一:
安装 matplotlib 包的旧版本
pip install matplotlib==3.1.0
方法二:
在---- 单一文件模式下,基于 PyInstaller contributor 的提交操作,它引用了 https://github.com/PyInstaller/PyInstaller/issues/5004文件,你可以修改 PyInstaller 的钩子 hook-matplotlib.py ,这样它就有了:
datas = [
(mpl_data_dir, "matplotlib/mpl-data"),

当使用PyInstaller打包Python程序时,如果遇到matplotlib相关的AssertionError,可以尝试两种方法解决。方法一是通过安装matplotlib的旧版本,如3.1.0;方法二是修改PyInstaller的hook-matplotlib.py文件,添加指定的datas配置。参考链接提供了详细的操作指导。
最低0.47元/天 解锁文章

3060

被折叠的 条评论
为什么被折叠?



