Python PIL import Mac compatiblity
Question: I wonder now for a long time, can I redirect python imports. So on my Machine
I did:

    
    
    pip install pil
    

and then I can do:

    
    
    from PIL import Image
    

That works great but the problem is many programs just want Image, they want:

    
    
    import Image
    

Now my question is can I "redirect" the above statement so that I can use
import Image? If that does not work, how could I make it work?


Answer: Basically you can use any of the methods mentioned
[here](https://docs.python.org/2/library/site.html).

On my linux installation, PIL already uses one of those - there's a directory
called PILcompat which has files like Image.py, and a file called
PILcompat.pth which is used to tell python to add this directory to its module
search path. This way when

    
    
     import Image 
    

is executed, python finds PILcompat/Image.py which executes its contents -

    
    
     from PIL.Image import *
    

I'm guessing either the .pth file or the directory are missing on your
machine.

