Ubuntu: Unable to run python code because of Cycler dependency of Matplotlib



Question:

I have a small python program that calls on matplotlib. It seems that this library is dependent on "Cycler" which is giving me this error:

Traceback (most recent call last):    File "main.py", line 1, in <module>      import matplotlib.pyplot as plt    File "/usr/local/lib/python2.7/dist-packages/matplotlib-2.0.0+3318.g9e7e15b-py2.7-linux-x86_64.egg/matplotlib/__init__.py", line 1158, in <module>      rcParams = rc_params()    File "/usr/local/lib/python2.7/dist-packages/matplotlib-2.0.0+3318.g9e7e15b-py2.7-linux-x86_64.egg/matplotlib/__init__.py", line 1000, in rc_params      return rc_params_from_file(fname, fail_on_error)    File "/usr/local/lib/python2.7/dist-packages/matplotlib-2.0.0+3318.g9e7e15b-py2.7-linux-x86_64.egg/matplotlib/__init__.py", line 1134, in rc_params_from_file      if key not in _all_deprecated])    File "/usr/local/lib/python2.7/dist-packages/matplotlib-2.0.0+3318.g9e7e15b-py2.7-linux-x86_64.egg/matplotlib/__init__.py", line 891, in __init__      self.update(*args, **kwargs)    File "/usr/lib/python2.7/_abcoll.py", line 572, in update      self[key] = value    File "/usr/local/lib/python2.7/dist-packages/matplotlib-2.0.0+3318.g9e7e15b-py2.7-linux-x86_64.egg/matplotlib/__init__.py", line 914, in __setitem__      cval = self.validate[key](val)    File "/usr/local/lib/python2.7/dist-packages/matplotlib-2.0.0+3318.g9e7e15b-py2.7-linux-x86_64.egg/matplotlib/rcsetup.py", line 852, in validate_cycler      cycler_inst.change_key(prop, norm_prop)  AttributeError: 'Cycler' object has no attribute 'change_key'  

Can anyone help me out with this?


Solution:1

You need to update the Cycler dependency, run the following code:

pip install -U cycler  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »