Hi,
hi, I'm installing lxml-2.3 on FreeBSD 8.2. Been working on this for a couple of days... I installed the latest libxml2, libxslt, Python2.7 in a non-standard location, '/AppDocs/local'
[...]
from lxml import etree Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: Shared object "libxml2.so.9" not found, required by "etree.so"
The file libxml2.so.9 is in the /AppDocs/local/lib directory. More info: lxml2-config: -L/AppDocs/local/lib -lxml2 -lz -lpthread -lm -I/AppDocs/local/include/libxml2 2.7.8
xslt-config -L/AppDocs/local/lib -lxslt -lxml2 -lz -lpthread -lm -I/AppDocs/local/include -I/AppDocs/local/include/libxml2 1.1.26
Never been on FreeBSD, but anyhow: You probably need to add your non-standard locations to the runtime library search path. Try running with your lib install directory added to LD_LIBRARY_PATH (guess this also works on FreeBSD?), i.e. LD_LIBRARY_PATH=/AppDocs/local/lib python, to see if this makes a difference. My xslt-config looks like this: /apps/prod/libxslt/current/bin/xslt-config --libs -L/apps/prod/libxslt/1.1.14/lib -L/apps/prod/libxml2/2.6.20/lib -R/apps/prod/libxml2/2.6.20/lib -L/apps/prod/zlib/1.2.3/lib -R/apps/prod/zlib/1.2.3/lib -lxslt -lxml2 -lz -lpthread -lsocket -lnsl -lm Note the -R<path> stuff which causes etree.so to have this stuff added to its runtime lib search path: $ elfdump -d lxml/etree.so Dynamic Section: .dynamic index tag value [0] NEEDED 0x2a98 libxslt.so.1 [1] NEEDED 0x2aa5 libexslt.so.0 [2] NEEDED 0x2ab3 libxml2.so.2 [3] NEEDED 0x2ac0 libz.so [4] NEEDED 0x2ac8 libm.so.1 [5] RPATH 0x2af1 /apps/prod//libxml2/2.6.32/lib:/apps/prod//libxslt/1.1.23/lib:/apps/prod/lib Btw: Does running /AppDocs/local/bin/xsltproc work for you or do you also get the dependency problem? So what you could do is: * build libxml2/libxslt in a way that they add the runtime lib search path into their config, which lxml uses in turn (probably not an option if you don't build yourself but just install) * use LD_LIBRARY_PATH (quick but ugly imho) * use ldconfig (or the FreeBSD analogon?) which is common on Linux to add your non-standard paths to the runtime linker search path * set the rpath as an option to setup.py's build_ext command (or put it into in setup.cfg), e.g. setup.py build_ext --rpath=<your path> Holger -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone