2011-04-05 77 views
2

當我啓動我的應用程序使用的Apache2 + modwsgi 我趕上proble與soaplib(LXML)用的Apache2 + mod_wsgi的

 
Exception Type: ImportError 
Exception Value: DLL load failed: The specified module could not be found. 

符合

 
from lxml import etree 

和Django開發服務器一切工作正常 視覺C++ Redistributable 2008安裝

依賴walker告訴msvcrt90.dll錯過了 但是有相同的地方與cx_Oracle相似,但cx_Oracle的dll加載正確

有什麼想法?

的Windows 2003 Server和64位的Windows XP SP3 32位 Python 2.7版32位 cx_Oracle 5.0.4 32位

UPD: 下載libxml2-2.7.7和的libxslt-1.1.26

嘗試建立與setup.py建立--compiler的mingw32

 
Building lxml version 2.3. 
Building with Cython 0.14.1. 
ERROR: 'xslt-config' is not recognized as an internal or external command, 
operable program or batch file. 

** make sure the development packages of libxml2 and libxslt are installed ** 

Using build configuration of libxslt 
running build 
running build_py 
running build_ext 
skipping 'src/lxml\lxml.etree.c' Cython extension (up-to-date) 
building 'lxml.etree' extension 
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c src/lxml\lxml.etree.c -o build\temp.win32-2.7\Release\src\lxml\lxml.et 
ree.o -w 
writing build\temp.win32-2.7\Release\src\lxml\etree.def 
C:\MinGW\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.7\Release\src\lxml\lxml.etree.o build\temp.win32-2.7\Release\src\lxml\etree.def -LC:\Python27\lib 
s -LC:\Python27\PCbuild -llibxslt -llibexslt -llibxml2 -liconv -lzlib -lWS2_32 -lpython27 -lmsvcr90 -o build\lib.win32-2.7\lxml\etree.pyd 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0xd11): undefined reference to `_imp__xmlFree' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0xd24): undefined reference to `_imp__xmlFree' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0x1ee92): undefined reference to `_imp__xmlFree' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0x1eed6): undefined reference to `_imp__xmlFree' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0x2159e): undefined reference to `_imp__xmlMalloc' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0x2e741): undefined reference to `_imp__xmlFree' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0x2e784): undefined reference to `_imp__xmlFree' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0x3f157): undefined reference to `_imp__xmlFree' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0x3f19a): undefined reference to `_imp__xmlFree' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0x3f4ac): undefined reference to `_imp__xmlFree' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0x3f4ef): more undefined references to `_imp__xmlFree' follow 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0xb1ad5): undefined reference to `xsltLibxsltVersion' 
build\temp.win32-2.7\Release\src\lxml\lxml.etree.o:lxml.etree.c:(.text+0xb1b9a): undefined reference to `xsltDocDefaultLoader' 
collect2: ld returned 1 exit status 
error: command 'gcc' failed with exit status 1 

UPD2: 我明白爲什麼導入cx_Oracle工作正常:cx_Oracle.pyd包含「MSVCRT.dll」依賴etree.pyd沒有它

回答

2

確實是因爲'msvcrt90.dll'。從Python 2.6的微補丁修訂版的某處,他們停止構建擴展模塊的DLL的自動依賴關係,並依賴於Python可執行文件。當嵌入到其他系統中時,您將依賴於鏈接到DLL的可執行文件,而在Apache的情況下則不會。因此,Python的改變已經打破了許多在Windows上嵌入Python的系統,並且唯一的解決方案是每個擴展模塊都有自己的依賴關係,這些DLL依賴於許多不需要的DLL。 psycopg2擴展受到了嚴重的影響,他們已經改變了他們的構建,現在將自己的依賴添加回來。你可能會去尋找psycopg2發生的問題。其中一個解決方案是使用Windows上的MinGW編譯器重新構建擴展。

+0

我已更新我的問題 – 2011-04-06 05:34:23