Python application crash with error "ImportError: pyexpat.x86_64-linux-gnu.so: undefined symbol: XML_SetHashSalt" -
we use matlab's python engine interface matlab code python. there seems conflict used libexpact.so library.
a minimal buggy example be:
#!/usr/bin/env python xml.dom import minidom import matlab.engine = minidom.parse("solution_example.xml") print(a)
this produces output:
file "./minimal.py", line 9, in <module> = minidom.parse("solution_example.xml") file "/usr/lib/python2.7/xml/dom/minidom.py", line 1917, in parse xml.dom import expatbuilder file "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 32, in <module> xml.parsers import expat file "/usr/lib/python2.7/xml/parsers/expat.py", line 4, in <module> pyexpat import * importerror: /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so: undefined symbol: xml_sethashsalt
however, program runs fine when line import matlab.engine
omitted.
any ideas problem or how debug python import procedure?
thanks in advance!
i faced same error message morning , after looking around, found solution works me. re-post here. hope in future.
"it seems caused library conflicts libexpat. did
ldd /usr/lib/python2.7/lib-dynload/pyexpat.so
, realized libexpat.so.1 pointing /usr/local/lib/libexpat.so.1 rather /lib/x86_64-linux-gnu/libexpat.so.1 (the former referencing outdated version, 1.5.2 instead of 1.6.0). don't know libexpat in /usr/local/lib came from.i hide libexpat files in /usr/local/lib (renamed .backup appended) , running
ldd /usr/lib/python2.7/lib-dynload/pyexpat.so
displays line "libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1" , update-manager works correctly."
Comments
Post a Comment