python 打包exe出现RuntimeError: Could not find the matplotlib data files 的解决方法
在打包包含matplotlib庫時(shí)出現(xiàn)RuntimeError: Could not find the matplotlib data files的解決方法。
錯(cuò)誤提示里面的介紹:
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里)或者虛擬環(huán)境下,看你在哪里打包,就在哪里裝
第二步:打包
pyinstaller -F XXX.py 第三步:修改spec文件
原h(huán)iddenimports=[],
修改后
hiddenimports=[‘matplotlib’],
第四步:重新打包
pyinstaller -F XXX.specok
可以運(yùn)行
更多打包講解
python將資源文件一起打包進(jìn)exe 講解(有算例)
電氣專業(yè)的計(jì)算機(jī)萌新:余登武。寫博文不容易。如果你覺得本文對(duì)你有用,請(qǐng)點(diǎn)個(gè)贊支持下,謝謝。
總結(jié)
以上是生活随笔為你收集整理的python 打包exe出现RuntimeError: Could not find the matplotlib data files 的解决方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 初中生长沙有读几年直接去部队的吗
- 下一篇: 东莞口罩机厂家哪个生产口罩机型号全?