On May 20, 3:42 pm, Austin Govella <[EMAIL PROTECTED]> wrote: > It was a PYTHONPATH problem. I fixed it using this tutorial: > *http://emmby.blogspot.com/2008/05/installing-python-pil-on-mac-os-x-1... > > (I'm using python 2.4, so I adjusted the path accordingly.) > > Everything validates. Server runs with no ImageField errors, but now > we get a new ImportError: "No module named ImageFile". > > That error corresponds to the closed ticket, #7019: > http://code.djangoproject.com/ticket/7019 > > Mr. Treddinick writes MacPorts doesn't correctly install PIL on os x > 10.4: > > "This isn't a problem with Django. It's a problem with the way PIL is > installed and should be reported to the packager for fixing. PIL > should be installed so that the PIL directory is part of the Python > module search path (normally done via a PIL.pth file) and thus import > ImageFile must work; otherwise it's installed incorrectly." > > Does anyone know how to fix this? What path should I add/edit where? > > (And as an aside, I read somewhere that the proper way to import Image > and ImageFile is to say "from PIL import ImageFile". This works, but > "import ImageFile" doesn't. Is Django importing incorrectly?) > > Many thanks for any tips,
I could be wrong, but the way I have understood things is that initial PIL people put stuff at global module level. After a while they possibly realised their evil ways and pushed things into a PIL package. To maintain compatibility with older way they did things they add a PIL.pth file containing 'PIL'. In other words both: import Image and: from PIL import Image work. I personally would suggest that any code which doesn't import it out of PIL package should be changed as it is propagating bad practice. Thus, if Django is saying just: import Image then it probably should be changed. Anyway, my 2 cents worth. Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---