当我调用启动脚本时,我正在使用一个适用于Tkinter的程序,但是当我告诉它绘制图形时,我会收到错误:
> Exception in Tkinter callback Traceback (most recent call last):
> File
> "/home/user/Canopy/appdata/canopy-1.7.2.3327.rh5-x86_64/lib/python2.7/lib-tk/Tkinter.py",
> line 1536, in __call__
> return self.func(*args) File "/home/user/Canopy/appdata/canopy-1.7.2.3327.rh5-x86_64/lib/python2.7/lib-tk/Tkinter.py",
> line 587, in callit
> func(*args) File "/home/user/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py",
> line 373, in idle_draw
> self.draw() File "/home/user/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py",
> line 355, in draw
> tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) File
> "/home/user/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/backends/tkagg.py", line 30, in blit
> id(data), colormode, id(bbox_array)) TclError
我有Ubuntu 16.04 LTS,python 2.7.11,Canopy 1.7.2,我试图在Canopy偏好设置上从Qt4将PyLab后端更改为SVG,但没有任何改变。此外,由于该程序正在尝试做一些情节,我想因为Tkinter我也从程序收到错误:
RuntimeError Traceback (most recent call last)
/home/user/Enthought/Canopy_64bit/User/bin/snpy in <module>()
----> 1 s.fit()
/home/user/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/snpy/sn.pyc in fit(self, bands, mangle, kcorr, reset_kcorrs, k_stretch, margs, **args)
1291 self.model.fit(bands, **args)
1292 if self.replot:
-> 1293 self.plot()
1294
1295 def fitMCMC(self, bands=None, Nwalkers=None, threads=1, Niter=500,
/home/user/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/snpy/sn.pyc in plot(self, **kwargs)
1615 '''
1616
-> 1617 return plotmod.plot_sn(self, **kwargs)
1618
1619 def plot_kcorrs(self, colors=None, symbols=None, outfile=None):
/home/user/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/snpy/plot_sne_mpl.pyc in plot_sn(self, **kwargs)
695 #p.draw()
696 p.set_limits(dox=(xrange is None), doy=(yrange is None), all_equal=1)
--> 697 p.draw()
698 outfile = kwargs.get('outfile', None)
699 if outfile is not None:
/home/user/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/snpy/myplotlib.pyc in draw(self, hide_corner_labels)
945 #3) Make room for everything:
946 if self._title is not None:
--> 947 title_height = self.get_bbox(self._title).height
948 else:
949 title_height = 0
/home/user/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/snpy/myplotlib.pyc in get_bbox(self, label)
738 def get_bbox(self, label):
739 '''If a title exists, how tall is it?'''
--> 740 bbox = label.get_window_extent()
741 bboxi = bbox.inverse_transformed(self.fig.transFigure)
742 return bboxi
/home/user/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/text.pyc in get_window_extent(self, renderer, dpi)
957 self._renderer = renderer
958 if self._renderer is None:
--> 959 raise RuntimeError('Cannot get window extent w/o renderer')
960
961 bbox, info, descent = self._get_layout(self._renderer)
RuntimeError: Cannot get window extent w/o renderer
即使所有这些错误,当我告诉它绘制图形时,它会显示一个带有保存选项的空白页面,当我保存时,我可以稍后通过打开保存的文件看到它,但是情节是如此混乱,因为渲染问题等等。有关于如何处理这个问题的建议吗?