Skip to content

Fresh matplotlib install broken: installs qt5, but matplotlib rc patched to require qt4 #1068

@jorisvandenbossche

Description

@jorisvandenbossche

Related to #1065 (but opening a new issue as this is not a Qt problem but how the matplotlib rc is patched AFAIU). Also reported it at matplotlib: matplotlib/matplotlib#7124 (comment)

When you do a fresh conda install matplotlib, this now installs qt/pyqt 5.x instead of 4.x.
But as far as I understand, anaconda patches matplotlib to default to qt4 backend. With the consequence that you get a ImportError: No module named 'PyQt4' error if you do not specify the backend to qt5agg manually.

Possible workarounds for now (either one of the two):

  • pin pyqt to 4.11
  • set the backend manually before importing pyplot (matplotlib.use('qt5agg'))

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions