[lxml-dev] DLL issue with win32 static builds of lxml
Hi I'm looking at upgrading our python installations from 2.6(.2) to 2.7 and upgrading the packages we use to the latest versions. We use python and the mod_wsgi module in Apache 2.2 for our application server and easy_install to install egg packages. I'm currently testing on a Windows 7 machine. The current egg version of lxml that we're using (before upgrading) is: lxml-2.2.4-py2.6-win32.egg In trying to upgrade things, I've found that all the later builds of lxml cause a DLL problem through apache. For example, all of these builds (from pipy) cause the problem: lxml-2.2.8-py2.6-win32.egg lxml-2.2.8-py2.7-win32.egg lxml-2.2beta1-py2.6-win32.egg lxml-2.3beta1-py2.6-win32.egg lxml-2.3beta1-py2.7-win32.egg (Note that there are no static win32 builds available for 2.2.5-2.2.7, or I can't find them) The error thrown in the Apache logs is: mod_wsgi (pid=4812): Target WSGI script 'C:/wsgi/handler.py' cannot be loaded as Python module. mod_wsgi (pid=4812): Exception occurred processing WSGI script 'C:/wsgi/handler.py'. Traceback (most recent call last): File "C:/wsgi/handler.py", line 2, in <module> from lxml import etree ImportError: DLL load failed: The specified module could not be found. The same file works in Python 2.6 if lxml 2.2.4 is installed, but fails for any other higher version of lxml (either in python 2.6 or 2.7). I've been able to trace the problem down to the builds not being able to find the msvcr90.dll file properly. I've tried modifying path variables and other changes, but can't figure out what the problem is. A couple of other things to note: - Using just "import lxml" doesn't cause the error, just "from lxml import etree" - The problem only occurs through Apache. If I write a script that references etree and call it through the command line, the problem doesn't occur. Does anyone know what I need to do? What changed after the 2.2.4 lxml builds? Thanks for any help you can give. Scott Smith
On Thu, Sep 30, 2010 at 4:26 PM, Scott Smith <scott.smith@primal.com> wrote:
Does anyone know what I need to do? What changed after the 2.2.4 lxml builds?
There's actually quite some things that changed. The laptop where I built the 2.2.4 version was stolen so I had to do everything from scratch. The version of libxml2 was changed as well, and things like that. But the fact it works from the command line is suspicious. I've had issues with mod_python not finding modules, but that was before mod_wsgi existed. I'd rule out any issues in your environment before anything else. -- Sidnei
Am 30.09.2010 22:47, schrieb Sidnei da Silva:
On Thu, Sep 30, 2010 at 4:26 PM, Scott Smith <scott.smith@primal.com> wrote:
Does anyone know what I need to do? What changed after the 2.2.4 lxml builds?
There's actually quite some things that changed. The laptop where I built the 2.2.4 version was stolen so I had to do everything from scratch. The version of libxml2 was changed as well, and things like that.
The issue smells like a problem with embedded manifests and dependency on the MSVCRT assembly. Are you embedding a manifest in the .pyd files or libxml2 and libxslt DLLs? During the development of Python 2.6 MvL has removed all manifests from Python extensions. It solved several issues related to not finding MSVCRT. Since all Python extensions depend on pythonXX.dll and the Python DLL depends on MSVCRT, the MSVCRT assembly is loaded anyway. Christian
On Sun, Oct 3, 2010 at 2:27 PM, Christian Heimes <lists@cheimes.de> wrote:
The issue smells like a problem with embedded manifests and dependency on the MSVCRT assembly. Are you embedding a manifest in the .pyd files or libxml2 and libxslt DLLs? During the development of Python 2.6 MvL has removed all manifests from Python extensions. It solved several issues related to not finding MSVCRT. Since all Python extensions depend on pythonXX.dll and the Python DLL depends on MSVCRT, the MSVCRT assembly is loaded anyway.
Now that you mention it, I think I had manually patched by local installation to disable the manifest embedding like MvL's patch on the laptop that was stolen, but not on the new one. I'll double check. -- Sidnei
Hello Sidnei, You mind updating the build instructions on the webpage? Monday, October 4, 2010, 3:17:44 PM, you wrote: SdS> On Sun, Oct 3, 2010 at 2:27 PM, Christian Heimes <lists@cheimes.de> wrote:
The issue smells like a problem with embedded manifests and dependency on the MSVCRT assembly. Are you embedding a manifest in the .pyd files or libxml2 and libxslt DLLs? During the development of Python 2.6 MvL has removed all manifests from Python extensions. It solved several issues related to not finding MSVCRT. Since all Python extensions depend on pythonXX.dll and the Python DLL depends on MSVCRT, the MSVCRT assembly is loaded anyway.
SdS> Now that you mention it, I think I had manually patched by local SdS> installation to disable the manifest embedding like MvL's patch on the SdS> laptop that was stolen, but not on the new one. I'll double check. SdS> -- Sidnei SdS> _______________________________________________ SdS> lxml-dev mailing list SdS> lxml-dev@codespeak.net SdS> http://codespeak.net/mailman/listinfo/lxml-dev -- Best regards, Adam GROSZER mailto:agroszer@gmail.com -- Quote of the day: Ceremony and great professing renders friendship as much suspect as it does religion. - William Wycherley
So, did you found solution or no?
participants (5)
-
Adam GROSZER
-
Andrew
-
Christian Heimes
-
Scott Smith
-
Sidnei da Silva