Ubuntu18.04+Python3.6, 用pyinstaller打包,命令pyinstaller -F xxx.spec
运行的时候提示NameError: name ‘defaultParams‘ is not defined,发现是matplot的问题,先卸载重装,发现问题仍存在,然后去网上查,给出了一些windows环境下的解决方案,替换到Ubuntu系统:
cd /usr/local/lib/python3.6/dist-packages/matplotlib
sudo vim __init__.py
注释掉下图中高亮显示的defaultParams(应该是在563行)
保存,退出,重新打包,
问题解决。