0

I'm trying to use matplotlib but I'm getting this error saying "No Module named six". I read previous answers and installed six using pip and also tried pip install six --upgrade. But nothing worked. What could be wrong?

EDIT:

The TraceBack:

Traceback (most recent call last):
  File "<string>", line 254, in run_nodebug
  File "C:\Users\Akshay\Documents\Internship.py", line 290, in <module>
    from matplotlib import pyplot
  File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 105, in <module>
    import six
ImportError: No module named six

And sorry I'm unfamiliar with the which command. I'm using Python 2.7, and the latest pip.

Anamaki
  • 101
  • 3
  • Please include the full python stack trace for your ImportError. Also include the output of `which pip` and `which python`. – cel Jan 09 '15 at 11:21
  • Do I type "which pip" in the Command prompt? It shows that "which" is not an internal or external command – Anamaki Jan 09 '15 at 15:48
  • You're on Windows. `which` is a `*nix` command; it won't work for you. –  Jan 09 '15 at 15:50
  • 1
    Have you run `python` on the command line, and then in the Python prompt, typed `>>> import six`? If that doesn't work, `pip` installed `six` in a weird way, or rather, `python` and `pip` are unrelated (which is what @cel was hinting at). –  Jan 09 '15 at 15:52
  • 1
    SO suggests that `where` on windows is somewhat equivalent to `which`, you could try that instead. But I would see first if `python -m pip install six` fixes the problem for you. – cel Jan 09 '15 at 16:51
  • Before I did the -m command import six did nothing, but after I ran the -m command it worked! What did -m do? Also post your comment as an answer so I can accept it. – Anamaki Jan 09 '15 at 21:56
  • Your pip binary did not belong to the python interpreter you are currently using. So using `pip install six` installed the package for the wrong interpreter. `python -m pip install six` is a neat hack to make sure that you call the right `pip` – cel Jan 09 '15 at 22:53
  • In case six is stored under the wrong Python version, see my [kludge][1] [1]: http://stackoverflow.com/questions/26859356/error-no-module-named-six – Prune Sep 03 '15 at 22:39

0 Answers0