#6054: PIL import error
---------------------------------------------+------------------------------
          Reporter:  nesh                    |         Owner:  nobody
            Status:  closed                  |     Milestone:        
         Component:  Validators              |       Version:  SVN   
        Resolution:  invalid                 |      Keywords:  PIL   
             Stage:  Design decision needed  |     Has_patch:  0     
        Needs_docs:  0                       |   Needs_tests:  1     
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by junkafarian):

 In the mean time, a quick fix which saves you screwing around with
 multiple core django files and will allow both recognised PIL import
 behaviours:

 {{{
 >>> import Image
 }}}
 and
 {{{
 >>> from PIL import Image
 }}}

 is to write a PIL.py file in the egg directory which imports the necessary
 PIL modules. For Django which requires "Image" and "!ImageFile" as pointed
 out by haloween the following command should suffice:

 {{{
 junkafarian:~ junkafarian$ echo "import Image, ImageFile" >> /path/to/env
 /site-packages/PIL-[version].egg/PIL.py
 }}}

 The major problem with this hack is that you will need to include all the
 modules you require for the project in the import statement (which may be
 more than just "Image" and "!ImageFile")

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6054#comment:7>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to