-1

I'm trying a test code and it can't find cycler this code:

import matplotlib.pyplot as plt
plt.plot([1,2,10,4])
plt.ylabel("some numbers")
plt.show()

returns the error:

ImportError: No module named cycler
  • 1
    Your code seems to be fine. The error may come from other lines which you didn't show. Maybe check all your `import` line and see if you are trying to import something like `cycler`. That might be the real problem. – Y. Luo Jun 07 '17 at 17:38

3 Answers3

0

matplotlib relies on cycler. with some versions of matplotlib it was not listed as prerequisite. possible duplicate of ImportError: No module named cycler

try installing cycler, with the same method that you used for matplotlib ideally

sudo apt-get python-cycler

for instance

Pierre de Buyl
  • 7,074
  • 2
  • 16
  • 22
  • Traceback (most recent call last): File "C:/Python27\matplotlib\artist.py", line 15, in from .transforms import (Bbox, IdentityTransform, TransformedBbox, File "C:/Python27\matplotlib\transforms.py", line 39, in from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox, ImportError: No module named _path – William Parry Jun 08 '17 at 15:01
  • How did you install the packages? (both matplotlib and cycler). Please describe the steps with full detail (download from this or that web site, unpacking, building, etc). – Pierre de Buyl Jun 08 '17 at 16:51
  • downloaded->went to downloads->unpacked with winzip to python27 folder on acer C: – William Parry Jun 11 '17 at 10:39
  • This method only works for pure python package. For packages that rely on compiled extensions, the procedure is more complex. You can have a look at http://www.scipy-lectures.org/intro/intro.html#before-starting-installing-a-working-environment https://scipy.org/install.html or http://matplotlib.org/users/installing.html – Pierre de Buyl Jun 11 '17 at 17:52
0

Try not only to install/reinstall cycler, but also to restart the kernel after (in my case it helped)

Asiya S.
  • 1
  • 1
0
conda install cycler

worked for me!

Gurkan Soykan
  • 156
  • 2
  • 6