lxml runtime error: Reason: Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0

BlueFrog picture BlueFrog · Apr 19, 2014 · Viewed 18.3k times · Source

I have a perplexing problem. I have used mac version 10.9, anaconda 3.4.1, python 2.7.6.

Developing web application with python-amazon-product-api. i have overcome an obstacle about installing lxml, referencing clang error: unknown argument: '-mno-fused-madd' (python package installation failure).

but another runtime error happened. Here is the output from webbrowser.

Exception Type: ImportError
Exception Value:    
dlopen(/Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so, 2): Library not loaded: libxml2.2.dylib
Referenced from: /Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so
Reason: Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0

Not sure how to proceed and have searched here and elsewhere for this particular error. Any help is much appreciated!

Answer

jessems picture jessems · Jul 24, 2015

This worked for me:

brew install libxml2
brew install libxslt
brew link libxml2 --force
brew link libxslt --force