On 25 January 2011 20:29, Jacek Naruniec <[email protected]> wrote: > Hi, > I've got the problem, that I've seen on many sites, but none of them > helped so far. My created webpage uses Django, Apache, Python2.7, PIL > 1.2.7 (for Python 2.7) and mod_wsgi (for Python 2.7) running on > Windows - all the latest releases. PIL and mod_wsgi was already > compiled, i have'nt done it manually. > > When I try to use imaging library in plain python, everything is > working, the _imaging library is successfully initialized. Sys.path is > correct and points the PIL library. > > Using mod_wsgi the sys.path is also correct (i've checked it by using > application script in wsgi file), but still the "The _imaging C module > is not installed" appears when when I try to use PIL. > When i try to load _imaging library in the wsgi file, the log in the > apache says "ImportError: DLL load failed" and that it cannot find the > module. > > Does anyone know how to deal with this thing?
Am wandering if this is the same problem as is affecting psycopg2 and potentially other C extension modules such as libcrypto. That is, Python 2.6+ links to newer MS C runtime library that Apache doesn't and C extension modules which are somehow dependent on the newer MS C runtime library will not load properly. Prior to Python 2.6 I believe psycopg2 was itself linking this MS C runtime library and so was okay, but since that was no longer required for Python 2.6+ or caused problems they stopped doing that on the assumption that it would already be linked. In embedded system like mod_wsgi you are dependent on the executing application, Apache in this case, linking it as Python does, but Apache doesn't, thus the problem. I am a bit fuzzy on this and could have this wrong. If I am sort of right, the solution may be to relink mod_wsgi.so for Windows with dependency on new MS C runtime library. The library at issue seems to be MSVCRT90, but I don't understand all the issues around it as don't know Windows. Can someone help me to understand this. Relevant links: http://archives.postgresql.org/psycopg/2011-01/msg00009.php http://psycopg.lighthouseapp.com/projects/62710/tickets/20 http://groups.google.com/group/modwsgi/browse_thread/thread/13b4a5faa962d77/dd4d6a03afbe16b6 http://bugs.python.org/issue4120 The last one is perhaps the most informative about the change that potentially caused the problem. Graham -- You received this message because you are subscribed to the Google Groups "modwsgi" 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/modwsgi?hl=en.
