python 打包exe出现RuntimeError: Could not find the matplotlib data files 的解决方法
在打包包含matplotlib庫時出現RuntimeError: Could not find the matplotlib data files的解決方法。
錯誤提示里面的介紹:
MatplotlibDeprecationWarning: Matplotlib installs where the data is not in the mpl-data subdirectory of the package are deprecated since 3.2 and support for them will be removed two minor releases later.
原因 matplotlib3.2以后就把mpl-data分離出去了
所以解決方法
第一步:卸載,重裝(在anaconda prompt里)或者虛擬環境下,看你在哪里打包,就在哪里裝
第二步:打包
pyinstaller -F XXX.py 第三步:修改spec文件
原hiddenimports=[],
修改后
hiddenimports=[‘matplotlib’],
第四步:重新打包
pyinstaller -F XXX.specok
可以運行
更多打包講解
python將資源文件一起打包進exe 講解(有算例)
電氣專業的計算機萌新:余登武。寫博文不容易。如果你覺得本文對你有用,請點個贊支持下,謝謝。
總結
以上是生活随笔為你收集整理的python 打包exe出现RuntimeError: Could not find the matplotlib data files 的解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 初中生长沙有读几年直接去部队的吗
- 下一篇: 东莞口罩机厂家哪个生产口罩机型号全?