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

Conda install triggers known Matplotlib error #205

Closed
rebeccabilbro opened this Issue Apr 24, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@rebeccabilbro
Collaborator

rebeccabilbro commented Apr 24, 2017

@bbengfort @jkeung I was able to successfully install the conda package on a virtual machine that has Anaconda, but I ran into a known matplotlib issue when trying to import the package:

Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yellowbrick as yb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/anaconda3/lib/python3.5/site-packages/yellowbrick/__init__.py", line 29, in <module>
    from .style.rcmod import *
  File "/root/anaconda3/lib/python3.5/site-packages/yellowbrick/style/__init__.py", line 21, in <module>
    from .palettes import *
  File "/root/anaconda3/lib/python3.5/site-packages/yellowbrick/style/palettes.py", line 9, in <module>
    import matplotlib.pyplot as plt
  File "/root/anaconda3/lib/python3.5/site-packages/matplotlib/pyplot.py", line 115, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/root/anaconda3/lib/python3.5/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/root/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py", line 16, in <module>
    from .backend_qt5 import QtCore
  File "/root/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_qt5.py", line 26, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "/root/anaconda3/lib/python3.5/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 20, in <module>
    import matplotlib.backends.qt_editor.formlayout as formlayout
  File "/root/anaconda3/lib/python3.5/site-packages/matplotlib/backends/qt_editor/formlayout.py", line 56, in <module>
    from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
  File "/root/anaconda3/lib/python3.5/site-packages/matplotlib/backends/qt_compat.py", line 137, in <module>
    from PyQt4 import QtCore, QtGui
ImportError: No module named 'PyQt4'

Unfortunately, this means that we (yellowbrick developers) can't do much to fix the issue until Anaconda and Matplotlib development synchronizes.

Until then, add a note to quick start docs to communicate to users the two fixes:

  1. Pin PyQT4
  2. Change the matplotlib backend
@bbengfort

This comment has been minimized.

Member

bbengfort commented Apr 24, 2017

@rebeccabilbro you tried this on a linux machine, right?

@rebeccabilbro

This comment has been minimized.

Collaborator

rebeccabilbro commented Apr 24, 2017

Yes, Red Hat Linux 4.4.7 virtual machine

@bbengfort

This comment has been minimized.

Member

bbengfort commented Apr 24, 2017

From what I can tell (though I'd only bet a donut on this) -- this is a Linux only issue, so one thing we can say is that we prefer installation with pip for OS X and Linux, and conda for Windows.

@bbengfort

This comment has been minimized.

Member

bbengfort commented May 5, 2017

I've added a note in both the README and the new Quickstart (along with installation instructions for Anaconda) -- so I think that solves this issue. Will close when I push.

@bbengfort bbengfort closed this in 71ab343 May 5, 2017

@Juanlu001

This comment has been minimized.

Juanlu001 commented Sep 30, 2018

matplotlib 3.0 has changed the backend selection logic, perhaps someone wants to check if this is still an issue.

@rebeccabilbro

This comment has been minimized.

Collaborator

rebeccabilbro commented Sep 30, 2018

Hello @Juanlu001 and thanks so much for noting this! I was also noticing some weird things happening after upgrading to matplotlib 3.0; I've submitted a PR, which as a temporary solution, will at least let people know what the mpl requirements are for YB. However, we definitely need to start discussing a comprehensive fix in Yellowbrick. Would you be interested in adding a new issue to our backlog about the updates in mpl 3.0 regarding how the backend is selected, so that we can start discussing the best way to approach the fix? And of course any recommendations would be most welcome!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment