title: What is going on with PIL and the import statement
body: <p>I find this code in Django:</p>
  
  <pre><code># Try to import PIL in either of the two ways it can end up installed.
  try:
      from PIL import ImageFile as PILImageFile
  except ImportError:
      import ImageFile as PILImageFile
  </code></pre>
  
  <p>and up until recently, I just blew it off as unimportant.   However I built PIL under my virtualenv in windows and all of a sudden</p>
  
  <pre><code>from PIL import Image
  </code></pre>
  
  <p>doesn't work anymore, I have to use</p>
  
  <pre><code>import Image
  </code></pre>
  
  <p>So, now I want to understand why and what is going on.  </p>
  
  <p>Initially I was using PIL installed with the <a href="http://www.pythonware.com/products/pil/" rel="nofollow noreferrer">windows installer</a>.  But I <a href="https://stackoverflow.com/questions/7034015/handling-group4-tiff-images-in-python">needed read support for Group4 Faxes</a> so I did the mods and then got PIL to build and install under virtualenv on windows (something that is trivial on linux and a PITA on windows).  But, now I have to use the second form of import, even though <code>pip freeze</code> shows that <code>PIL==1.1.7</code> in installed.</p>
  
  <p>How is it that first import form doesn't work even though PIL appears to be installed, and the second form works (and the PIL code is functioning), indicating it is installed, but doesn't show up under PIL.</p>