open-cogsci / datamatrix

An intuitive, Pythonic way to work with tabular data
https://pydatamatrix.eu/
GNU General Public License v3.0
25 stars 10 forks source link

AttributeError with matplotlib cycler #6

Closed dschreij closed 7 years ago

dschreij commented 7 years ago

I got the latest snapshot from Github and when I try to run example.py or add a datamatrix element in OpenSesame, I get:

Traceback (most recent call last):
  File "/Users/daniel/Github/OpenSesame/libqtopensesame/widgets/tree_overview.py", line 753, in dropEvent
    self.drop_event_item_new(data, e)
  File "/Users/daniel/Github/OpenSesame/libqtopensesame/widgets/tree_overview.py", line 672, in drop_event_item_new
    item, new_items = self.drop_get_item_snippet(data)
  File "/Users/daniel/Github/OpenSesame/libqtopensesame/widgets/tree_overview.py", line 560, in drop_get_item_snippet
    catch_exceptions=False)
  File "/Users/daniel/Github/OpenSesame/libqtopensesame/misc/qtitem_store.py", line 105, in new
    script=script)
  File "/Users/daniel/Github/OpenSesame/libopensesame/item_store.py", line 172, in new
    fromlist=[u'dummy'])
  File "/Users/daniel/Github/OpenSesame/libqtopensesame/items/loop.py", line 21, in <module>
    from qdatamatrix import QDataMatrix
  File "../smathot/python-qdatamatrix/qdatamatrix/__init__.py", line 22, in <module>
    from datamatrix.py3compat import *
  File "../smathot/python-datamatrix/datamatrix/__init__.py", line 21, in <module>
    import datamatrix.monkeypatch
  File "../smathot/python-datamatrix/datamatrix/monkeypatch.py", line 47, in <module>
    _monkey_patch_matplotlib()
  File "../smathot/python-datamatrix/datamatrix/monkeypatch.py", line 32, in _monkey_patch_matplotlib
    from matplotlib.axes import _base
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1182, in <module>
    rcParams = rc_params()
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1025, in rc_params
    return rc_params_from_file(fname, fail_on_error)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1158, in rc_params_from_file
    if key not in _all_deprecated])
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 907, in __init__
    self[k] = v
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 926, in __setitem__
    cval = self.validate[key](val)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 853, in validate_cycler
    cycler_inst.change_key(prop, norm_prop)
AttributeError: 'Cycler' object has no attribute 'change_key'

or when running python setup.py install from datamatrix

Traceback (most recent call last):
  File "setup.py", line 21, in <module>
    from datamatrix import __version__
  File "/Users/daniel/Github/smathot/python-datamatrix/datamatrix/__init__.py", line 21, in <module>
    import datamatrix.monkeypatch
  File "/Users/daniel/Github/smathot/python-datamatrix/datamatrix/monkeypatch.py", line 47, in <module>
    _monkey_patch_matplotlib()
  File "/Users/daniel/Github/smathot/python-datamatrix/datamatrix/monkeypatch.py", line 32, in _monkey_patch_matplotlib
    from matplotlib.axes import _base
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1182, in <module>
    rcParams = rc_params()
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1025, in rc_params
    return rc_params_from_file(fname, fail_on_error)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1158, in rc_params_from_file
    if key not in _all_deprecated])
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 907, in __init__
    self[k] = v
  File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 926, in __setitem__
    cval = self.validate[key](val)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 853, in validate_cycler
    cycler_inst.change_key(prop, norm_prop)
AttributeError: 'Cycler' object has no attribute 'change_key'

This probably has to do with Matplotlib (2.0.0), but I thought you may want to know.

dschreij commented 7 years ago

Hmm, I did a reinstall of matplotlib and the qt libraries and this seems to have fixed the problem (I do get a warning message about 'fastnumbers' though, but that seems to be unrelated). I don't think this was an issue with datamatrix and therefore closing this.