ImportError: No module named pyplot (even after installing matplotlib)
<p>I am trying to import matplotlib like so:</p>

<pre><code>import matplotlib.pyplot as plt
</code></pre>

<p>For this I have installed matplotlib using. </p>

<pre><code>python -m pip install -U pip setuptools
python -m pip install matplotlib
</code></pre>

<p>Although the <code>basic_example.py</code> from <a href="http://matplotlib.org/examples/index.html" rel="nofollow noreferrer">the examples</a> worked, it suddenly stopped running along with all other files with matplotlib giving me the below error:</p>

<pre><code>File "matplotlib.py", line 2, in &lt;module&gt;
  import matplotlib.pyplot as plt # pyplot module.
ImportError: No module named pyplot`
</code></pre>

<p>I tried to check if the module is still there, and it seems to be. What could be possibly wrong?</p>

<pre><code>Requirement already satisfied: matplotlib in c:\python27\lib\site-packages
Requirement already satisfied: numpy&gt;=1.6 in c:\python27\lib\site-packages (from matplotlib)
Requirement already satisfied: python-dateutil in c:\python27\lib\site-packages (from matplotlib)
Requirement already satisfied: cycler in c:\python27\lib\site-packages (from matplotlib)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,&gt;=1.5.6 in c:\python27\lib\site-packages (from matplotlib)
Requirement already satisfied: pytz in c:\python27\lib\site-packages (from matplotlib)
Requirement already satisfied: six&gt;=1.5 in c:\python27\lib\site-packages (from python-dateutil-&gt;matplotlib)`
</code></pre>

<p>I am using Windows and Python 2.7.</p>