title: Unable to "import matplotlib.pyplot as plt" in virtualenv
body: <p>I am working with flask in a virtual environment. I was able to install matplotlib with pip, and I can <code>import matplotlib</code> in a Python session. However, when I import it as </p>
  
  <pre><code>matplotlib.pyplot as plt
  </code></pre>
  
  <p>I get the following error: </p>
  
  <pre><code>&gt;&gt;&gt; import matplotlib.pyplot as plt
  
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "//anaconda/envs/myenv/lib/python2.7/site-packages/matplotlib/pyplot.py", line 109, in &lt;module&gt;
      _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
    File "//anaconda/envs/myenv/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
      globals(),locals(),[backend_name],0)
    File "//anaconda/envs/myenv/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 24, in &lt;module&gt;
      from matplotlib.backends import _macosx
  RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends.
  </code></pre>
  
  <p>I am confused about why it asks me to install Python as framework. Doesn't it already exists? What does it mean to "install Python as framework", and how do I install it? </p>