NameError: name ‘defaultParams‘ is not defined

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行)

保存,退出,重新打包,

问题解决。

猜你喜欢

转载自blog.csdn.net/whuzhang16/article/details/110522179