question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Matplotlib forced on qt4 with Spyder

See original GitHub issue

Hello everybody, I recently reinstalled Anaconda, since I was still using python 2 and since, I can’t plot anything with Matplotlib even the simplest code: import matplotlib.pyplot as pyplot pyplot.plot([1, 2, 3, 4, 5, 6],[4, 5, 1, 3, 6, 7]) pyplot.show() raises an exception: "Cannot load backend ‘Qt4Agg’ which requires the ‘qt4’ interactive framework, as ‘qt5’ is currently running "

No matter what I do to force matlab on qt5, each time I run my code, it wants to go on qt4. On the other hand, everything works fine on Conda (but it is less convenient to code there) Do any of you happens to know the why and how of this problem?

Versions

Spyder version: 3.3.6 Python version: 3.7 Qt version: 5.9.6 PyQt version: 5.9.2 Operating System name/version: win32 - Windows 10

Dependencies

IPython >=4.0     :  7.6.1 (OK)
cython >=0.21     :  0.29.12 (OK)
jedi >=0.9.0      :  0.13.3 (OK)
matplotlib >=2.0.0:  3.1.1 (OK)
nbconvert >=4.0   :  5.5.0 (OK)
numpy >=1.7       :  1.16.4 (OK)
pandas >=0.13.1   :  0.24.2 (OK)
pycodestyle >=2.3 :  2.5.0 (OK)
pyflakes >=0.6.0  :  2.1.1 (OK)
pygments >=2.0    :  2.4.2 (OK)
pylint >=0.25     :  2.3.1 (OK)
qtconsole >=4.2.0 :  4.5.1 (OK)
rope >=0.9.4      :  0.14.0 (OK)
sphinx >=0.6.6    :  2.1.2 (OK)
sympy >=0.7.3     :  1.4 (OK)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ajaykumar2017commented, Mar 26, 2020

Hi I am getting Error Cannot load backend ‘Qt4Agg’ which requires the ‘qt4’ interactive framework, as ‘qt5’ is currently running Tell me how to resolve it…?

0reactions
ccordoba12commented, Oct 24, 2019

I’m sorry but I don’t know what happens in your case. The only solution that occurs to me is to go to

Tools > Preferences > IPython console > Graphics

deactivate the option called Activate support and run directly %matplotlib qt5 in our consoles.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I force Matplotlib to draw while in the ipdb debugger in ...
Attempt #3: Run baz.bar from IPython from command line ... Open IPython from commandline: In [4]: import baz --Return-- None > somewhere_over_the_rainbow\baz.py(4) ...
Read more >
https://matplotlib.org/stable/_sources/api/backend...
While both PyQt and Qt for Python (aka PySide) closely mirror the ... are provided and force the use of a Qt5 binding...
Read more >
How to Plot Inline and With Qt - Matplotlib with IPython/Jupyter ...
In that case, the inline plotting can be forced in one of two ways. You can set the inline function, instead of qt...
Read more >
Raising a Figure Window to the Foreground
Set the Graphics Backend to “Qt” in the Spyder preferences menu. ... A graphics backend is the software that Python uses to physically...
Read more >
Spyder won't open - Q&A di Informatica
Run Spyder from an Anaconda prompt, by typing its name, watch it hang. ... QT related problem, possibly with PySide (Python's QT bindings)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found