win7下用py2exe打包Pyqt4+matplotlib出错(python2.7)
我用pyqt4做界面,里面嵌入了一个matplotlib显示图形的一个界面,现在用py2exe进行打包,打包完成后总是在嵌入的matplotlib显示错误,导致主界面也没法调用嵌入的界面,错误信息如下“Traceback (most recent call last):
File "mpl_pyqt4_widget_scope.py", line 9, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "matplotlibbackendsbackend_qt4agg.pyc", line 17, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "matplotlibbackendsbackend_qt5agg.pyc", line 35, in <module>
File "ctypes__init__.pyc", line 378, in __getattr__
File "ctypes__init__.pyc", line 383, in __getitem__
File "mpl_pyqt4_widget_scope.py", line 9, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "matplotlibbackendsbackend_qt4agg.pyc", line 17, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "matplotlibbackendsbackend_qt5agg.pyc", line 35, in <module>
File "ctypes__init__.pyc", line 378, in __getattr__
File "ctypes__init__.pyc", line 383, in __getitem__
AttributeError: function 'Py_DecRef' not found
在嵌入的matplotlib的图形界面用的是
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as NavigationToolbar
定位到对应是这两句话有问题,求打包方法。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
thx,我之前想用pyinstaller的,结果看了一个博说不太推荐,又去用py2exe了,本来用py2exe已经打好一个纯pyqt4的没有matplotlib的,看来还得试试pyinstaller,谢谢了