PY的编程内容
import os
import tempfile
os.environ[‘MPLCONFIGDIR’]=tempfile.mkdtemp()
来源:大概意思:电脑上少一个缓存的地方,所以要通过import加在了源码的py文件中了。
打包准备
推荐在虚拟环境中,将pyinstaller和matplotlib分别调级:
PyInstaller 3.6
python -m pip install pyinstaller == 3.6
matplotlib 3.2.2
python -m pip install matplotlib == 3.2.2
打包程序
pyinstaller -F -w D:\待打包的matplotlib.py