0

I have tried the command print(matplotlib.get_backend()) to get the backend and it says it is using Qt5Agg. I am not using a notebook (I changed to a code editor when I saw this: Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framework, as 'headless' is currently running).

These are my imports right now:

import matplotlib
matplotlib.use("Qt5Agg")
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.widgets import Slider, RangeSlider, RadioButtons, TextBox
import numpy as np

What surprises me the most is that yesterday I tried running this code in a jupyter notebook and it kind of worked (it was not interactive but at least it showed some graphics)...

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 13 '22 at 14:10
  • I suspect yesterday you tried it without that line `matplotlib.use("Qt5Agg")` and so it did something? Re-edit your post to actually ask a question. You've just described the situations. And vaguely at that. You were using a notebook and then switched to a code editor. And your environments aren't allowing what you seek. What do you need to get working? Do you care about the backend? Do you care if it is in Jupyter or prefer a script? Or just want to get something working? If so, what is that 'something'. Always best to post a minimal reproducible example of code. Even if it is toy code. – Wayne Oct 13 '22 at 20:46

0 Answers0