1

I have installed matplotlib using pip, conda and apt but am still getting this error when I use import command.

import matplotlib.pyplot as plt

This the error message

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-20-385145dcc870> in <module>()
----> 1 import matplotlib.pyplot as plt
      2 get_ipython().magic(u'matplotlib inline')

ImportError: No module named matplotlib.pyplot

How to fix this?

re3el
  • 735
  • 2
  • 12
  • 28
  • Have you installed matplotlib for the python you use? For example if you use python from an enclosed environment like 'anaconda' you have to install it IN that environment. Maybe you could give some more explanation about how you installed it and how you start/alias python. – MSeifert Oct 03 '15 at 15:37
  • @MSeifert i just gave `pip install matplotlib` in the terminal. Is there any way in which I can check if I installed it for the right version. I am using ipython notebook. – re3el Oct 03 '15 at 15:51
  • There is some explanation in the python docs: https://docs.python.org/3/installing/#work-with-multiple-versions-of-python-installed-in-parallel . But ipython is not a standalone, it works inside a specific python distribution. Maybe you should google some information about multiple python distributions and how to find out which you are using first. – MSeifert Oct 03 '15 at 16:00
  • 2
    May help understanding what's going on: http://stackoverflow.com/questions/32680081/importerror-after-successful-pip-installation/32680082#32680082 – cel Oct 03 '15 at 17:01
  • @cel: thanks! solved the issue :) – re3el Oct 04 '15 at 09:09

0 Answers0