ImportError: no module named cycler

I use wxpython and matplotlib for software development, when I finish my work, I want to convert python files to a "* .exe" file using py2exe, so it can be used on Windows. Here is the "setup .py".

from distutils.core import setup import py2exe import sys includes = ["encodings", "encodings.*"] sys.argv.append("py2exe") options = {"py2exe": { "bundle_files": 1 ,"dll_excludes":["MSVCP90.dll"]}} setup(options = options, zipfile=None, console = [{"script":'test.py'}]) 

Then I test.exe this script on python setup.py to generate test.exe , and it worked.

When I executed test.exe , there is an error message ImportError: No module named cycler

And then, I try to execute import cycler in python shell, and no error occurs. In addition, I checked the python directory c:/python27/Lib/site-packages/ , and the cycler-0.9.0-py2.7.egg file exists here.

How to deal with this problem.

+6
source share
2 answers

matplotlib calls cycler and it seems that cycler not been entered into matplotlib , which is the cause of the above error.

To fix this, just open Terminal (or the command line) and try running the command

$ sudo pip install cycler if you have pip installed

OR

$ sudo easy_install -U cycler if you have easy_install installed.

If this command succeeds, it should look like this: matplotlib can use it.

Even I had this problem, when I ran this command, my problem was resolved.

+4
source

If you are using anaconda, use:

 conda install cycler 
+2
source

All Articles