[Image-SIG] AccessInit: hash collision: 3 for both 1 and 1

Łukasz Langa lukasz at langa.pl
Sun Apr 18 02:18:47 CEST 2010


This is not a proper reply in terms of e-mail but I registered just a second ago just to write this post. So, here goes, replying to Frederik's message from Thu Apr 08 15:01:06 2010:
> Are you using some virtual env thing that might move modules around,
> btw?  I tried messing with the path to see if I could trick Python
> into importing the same thing twice on Windows, but failed under 2.6.
This is actually quite simple. When you easy_install PIL, you get the "pollute the global namespace" variant (e.g. import Image). Django on the other hand expects the "be pollite within your own namespace" variant (e.g. from PIL import Image). So if there's any .pth file or symbolic link that is supposed to cover for that, your going to have an error:

$ python
Python 2.6.5 (r265:79063, Mar 26 2010, 16:07:38) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _imaging
>>> import PIL._imaging
AccessInit: hash collision: 3 for both 1 and 1

The problem is, the default easy_install distribution does not provide the PIL.* variant whereas no stable Django version is as of yet using the global namespace version (see http://code.djangoproject.com/ticket/6054). The fact is that they on multiple occasions refused to make that change, I wonder what made them change their decision. That way or the other, it's a setuptools PIL packaging issue. Maybe the easiest and most compatible solution would be to simply include a PIL.py file along the distro with contents of the like:

import _imaging
import Image
import ImageFile
...

I don't really have the experience to make any remarks here, let alone decisions. So, it's up to you :)

-- 
Best regards,
Łukasz Langa
tel. +48 791 080 144
WWW http://lukasz.langa.pl/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20100418/21103753/attachment.html>


More information about the Image-SIG mailing list