Lxml: DLL loading error: the specified module was not found

I have Windows Server 2008 R2 x64. It runs Python27 x86 + Django 1.3 + apache 2.2 x86 under wsgi . It works fine without lxml.

We use soaplib, which requires lxml. I tried installing lxml in several ways:

  • using easy_install
  • Download the win32 binary installation.

The problem is that running under the site under apache raises the following error:

 ImportError at / DLL load failed: The specified module could not be found. 

This error occurs on from lxml import etree

I have googled for a solution, but did not find anything useful. Some information I found:

  • Something has changed in python26-> python27 which changes which dll files are included
  • I used dependencies to find which dlls are missing. I found that it is missing: gpsvc.dll, IEShims.dll, msvcr90.dll. When I tried to install the x86 redistributable package, but didn’t change anything. I tried to copy msvcr90.dll to egg dir lxml and created another error saying that it does not load the dll (I do not remember the exact exception, but I can throw it if necessary)

It works when launched from the django backend server by running manage.py runserver

How can I solve this problem? Thanks.

+6
source share
3 answers

I installed unofficial builds from http://www.lfd.uci.edu/~gohlke/pythonlibs/

He solved my problem.

+10
source

I had this problem when trying to download etree through the Windows Scripting Host. After using different approaches, I came across this Python 3.1 change, which suggests that new Python modules will no longer insert manifests, as this causes distribution problems without setting the MSVC ++ runtime:

So, I just loaded% PythonPath% \ Lib \ site-packages \ lxml \ etree.pyd into the Resource Hacker ( http://www.angusj.com/resourcehacker/ ) and deleted the manifest resource built into it.

+3
source

Installing a DLL is not enough, you will need to script Apache to use them. Cm:

http://groups.google.com/group/modwsgi/msg/afb025dc949c7051

+2
source

Source: https://habr.com/ru/post/896111/


All Articles