DistrictDataLabs / yellowbrick

Visual analysis and diagnostic tools to facilitate machine learning model selection.

Home Page:http://www.scikit-yb.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conda install triggers known Matplotlib error

rebeccabilbro opened this issue · comments

@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

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

Yes, Red Hat Linux 4.4.7 virtual machine

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.

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.

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

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!!

cant use the library as it is displaying an error" no module named yellowbrick" despite installation through pip or even conda.

cant use the library as it is displaying an error" no module named yellowbrick" despite installation through pip or even conda.

Hi again @kumar781 sorry you're having trouble; as noted in my response to you in #860 we would need more information about your installation and set-up to help you. If you continue to experience challenges with your installation, feel free to respond there with the details we requested!