ImportError: libexslt.so.0: cannot open shared object file: No such file or directory
Question: I am trying to use python 2.7.8 came with splunk 6 for some XML parsing usign
lxml.

    
    
    from lxml import etree
    

I see below error

    
    
    [root@**** bin]# ./python some.py
    Traceback (most recent call last):
      File "some.py", line 1, in <module>
        from lxml import etree
    ImportError: libexslt.so.0: cannot open shared object file: No such file or directory
    

Also I have this in splunk/lib/

    
    
    lrwxrwxrwx  libexslt.so -> libexslt.so.0.8.17
    lrwxrwxrwx  libexslt.so.0 -> libexslt.so.0.8.17
    -r-xr-xr-x  libexslt.so.0.8.17
    

Thanks for the help


Answer: Assuming you're running an operating system with manageable library paths
through ldconfig utility (like GNU/Linux), you can try the following:

    
    
    # echo "/your/path/to/splunk/lib" >> /etc/ld.so.conf.d/splunk.conf
    # ldconfig
    

The problem here is that the search path for the shared object isn't set, so
the application has no way to know where to find it.

If you're running an operating system that doesn't have ldconfig, i suggest
you search a bit for the utility that manages the library paths for that
particular case (or just update your question with more information).

If you don't have privileges on that system to perform such operations, you
can use environment variables to set such search paths, as suggested in the
link referred in the comments to your question (by @jedwards).

