MIC-DKFZ / niicat

This is a tool to quickly preview nifti images on the terminal
GNU General Public License v2.0
51 stars 10 forks source link

AttributeError: 'FigureCanvasGTK3Agg' object has no attribute 'renderer' #7

Open TheChymera opened 3 years ago

TheChymera commented 3 years ago

I get the following error when trying to run niicat — any ideas what could be wrong?

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.7/niicat", line 50, in <module>
    main()
  File "/usr/lib/python-exec/python3.7/niicat", line 46, in main
    plot(args.nifti_file, dpi=args.dpi)
  File "/usr/lib/python3.7/site-packages/niicat/plotter.py", line 254, in plot
    return _plot_nifti_preview(iFile, return_fig=return_fig, dpi=dpi)
  File "/usr/lib/python3.7/site-packages/niicat/plotter.py", line 233, in _plot_nifti_preview
    _plot_sixel(fig)
  File "/usr/lib/python3.7/site-packages/niicat/plotter.py", line 36, in _plot_sixel
    res = _sixel_encode(fig.canvas.buffer_rgba(), fig.get_figwidth()* dpi, fig.get_figheight() * dpi)
  File "/usr/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 444, in buffer_rgba
    return self.renderer.buffer_rgba()
AttributeError: 'FigureCanvasGTK3Agg' object has no attribute 'renderer'

My matplotlib installation has gtk3 support enabled (though the error remains the same with it disabled):

[U] dev-python/matplotlib
     Available versions:  3.2.2-r2^t (~)3.3.0-r1^t (~)3.3.1-r2^t {cairo doc examples excel gtk3 latex qt5 test tk wxwidgets PYTHON_TARGETS="python3_6 python3_7 python3_8 python3_9"}
     Installed versions:  3.2.2-r2^t(03:19:33 PM 09/18/2020)(cairo gtk3 latex wxwidgets -doc -examples -excel -qt5 -test -tk PYTHON_TARGETS="python3_7 -python3_6 -python3_8 -python3_9")
     Homepage:            https://matplotlib.org/
     Description:         Pure python plotting library with matlab like syntax
wasserth commented 3 years ago

Unfortunately I can not reproduce this error. Therefore I am not sure what is going wrong.

TheChymera commented 3 years ago

@wasserth thanks for the reply. Is there perhaps anything else I can do to provide a more informative traceback?