
mark grandi <markgrandi <at> gmail.com> writes:
ImportError: dlopen(/Users/markgrandi/Library/Python/3.2/lib/python/site-packages/ lxml-2.3.5-py3.2-macosx-10.6-intel.egg/lxml/etree.so, 2): Symbol not found: _lzma_auto_decoder Referenced from: /Users/markgrandi/Library/Python/3.2/lib/python/ site-packages/lxml-2.3.5- py3.2-macosx-10.6-intel.egg/lxml/etree.so Expected in: flat namespace in /Users/markgrandi/Library/Python/3.2/lib/python/site-packages/ lxml-2.3.5-py3.2-macosx-10.6-intel.egg/lxml/etree.so
no idea why =/
_________________________________________________________________ Mailing list for the lxml Python XML toolkit - http://lxml.de/ lxml <at> lxml.de https://mailman-mail5.webfaction.com/listinfo/lxml
Well, I seem to of figured it out. It seems that libxml2 by default tries to include lzma, but since I recently installed the xz libraries, its probably having some conflict with the static vs not static version of liblzma, so i edited the buildlibxml.py script to pass in a '--without-lzma' option, and that worked. My entire compile process is listed below. The setup script REALLY needs to be updated to work with recent versions of mac os x..... Corvidae:lxml-2.3.5 markgrandi$ echo $CFLAGS -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform /Developer/SDKs/MacOSX10.8.sdk/ Corvidae:lxml-2.3.5 markgrandi$ echo $LDFLAGS -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform /Developer/SDKs/MacOSX10.8.sdk/usr/lib then edit buildlibxml.py, at around line 316, you see # build libxml2 libxml2_configure_cmd = configure_cmd + [ '--without-python', '--with-iconv=%s' % prefix] add '--without-lzma' to that list, so it becomes # build libxml2 libxml2_configure_cmd = configure_cmd + [ '--without-python', '--with-iconv=%s' % prefix, '--without-lzma'] then run: ARCHFLAGS="-arch i386 -arch x86_64" python3 setup.py --static-deps build then test:
from lxml import etree x = etree.fromstring('''<note> ... <to> ... Tove ... </to> ... <from> ... Jani ... </from> ... <heading> ... Reminder ... </heading> ... <body> ... Don't forget me this weekend! ... </body> ... </note>'''.encode("utf-8")) x <Element note at 0x1013df0a0> etree.tostring(x) b"<note>\n<to>\nTove\n</to>\n<from>\nJani\n</from>\n<heading>\nReminder\n </heading>\n<body>\nDon't forget me this weekend!\n</body>\n</note>"