Skip to content

AttributeError: 'FigureCanvasQTAgg' object has no attribute 'callbacks' #1184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mherman-nm opened this issue Aug 31, 2012 · 3 comments
Closed
Milestone

Comments

@mherman-nm
Copy link

Calling pyplot.figure() multiple times causes a partial trace to appear in the terminal (partial because the entire chain of calls is not shown):

Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py", line 156, in
lambda: self.close_event())
File "/usr/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1564, in close_event
self.callbacks.process(s, event)
AttributeError: 'FigureCanvasQTAgg' object has no attribute 'callbacks'

This bug was reported on Nabble in May:

http://matplotlib.1069221.n5.nabble.com/Qt-close-bug-revisited-td35203.html

The first user to report this bug presented a simple bit of code for reproducing the bug:

import matplotlib.pyplot as plt
fig = plt.figure()
plt.plot([0, 1])
fig = plt.figure()
plt.plot([0, 1])

I am able to get the same error message using the same code.

python2-matplotlib 1.1.1-1
python2 2.7.3-2
archlinux 64 bit

-Mike

@efiring
Copy link
Member

efiring commented Sep 1, 2012

I was running into the same error upon quitting, so I suppressed it: #1098. Thank you for pointing out this method of triggering it, however, because it suggests that there may be a better way of handling it.

@tacaswell
Copy link
Member

@mherman-nm Can you still reproduce this on a mac with a current version of mpl?

@tacaswell
Copy link
Member

Closing this as it is 2+ years old and there is a work-around in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants