3

I am using pycharm for python in windows 8. I have installed the package matplotlib. I am using python 2.7 when i do import matplotlib there is no error.
However if i do matplotlib.pyplot as plt i am getting this following errors:

        Traceback (most recent call last):
  File "C:/Users/PiyushSudip/PycharmProjects/myFirst/test1.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 23, in <module>
    from matplotlib.figure import Figure, figaspect
  File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 18, in <module>
    from axes import Axes, SubplotBase, subplot_class_factory
  File "C:\Python27\lib\site-packages\matplotlib\axes\__init__.py", line 4, in <module>
    from ._subplots import *
  File "C:\Python27\lib\site-packages\matplotlib\axes\_subplots.py", line 10, in <module>
    from matplotlib.axes._axes import Axes
  File "C:\Python27\lib\site-packages\matplotlib\axes\_axes.py", line 18, in <module>
    from matplotlib.cbook import _string_to_bool, mplDeprecation
ImportError: cannot import name _string_to_bool

can anyone help figure out what i am doing wrong?

2
  • 2
    try: pip install six Commented Oct 9, 2014 at 23:19
  • I have alrady installed six, that error is gone now . However, there are still some pending errors. Commented Oct 10, 2014 at 0:09

1 Answer 1

4

http://matplotlib.org/users/installing.html#required-dependencies

There is a package called six which matplotlib depends on. Check to make sure it's installed, or install it from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#six

This site has packaged versions of many python modules which are easy to setup on windows, just download and run.

Also check the other dependencies to make sure you have them all, otherwise you might get another error for a different module

Sign up to request clarification or add additional context in comments.

1 Comment

It's possible this arose because your version isn't installed or updated properly. Try installing the latest version via lfd.uci.edu/~gohlke/pythonlibs/#matplotlib . Make sure you get the version which is designed for your version of python, i.e. 32/64 bit and 2.7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.