Re: [lxml] Building lxml with mac os x mountain lion fails.

My mistake, I should of clarified that this was for python 3. Easy_install works great but it doesn't run under python3... From: Brett Sent: 9/12/2012 12:11 AM To: lxml@lxml.de Subject: Re: [lxml] Building lxml with mac os x mountain lion fails. mark grandi <markgrandi <at> gmail.com> writes:
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 ...snip... add '--without-lzma' to that list, so it becomes
# build libxml2 libxml2_configure_cmd = configure_cmd + [ '--without-python', '--with-iconv=%s' % prefix, '--without-lzma'] ...snip...
I tried the following and it seems to work fine: lilliput:lxml-2.3.5 brett$ STATIC_DEPS=true sudo easy_install "lxml==2.3.5" lilliput:lxml-2.3.5 brett$ sudo python setup.py install lilliput:lxml-2.3.5 brett$ python
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 0x103b0cfa0> etree.tostring(x) "<note>\n <to>\n Tove\n </to>\n <from>\n Jani\n </from>\n <heading>\n Reminder\n </heading>\n <body>\n Don't forget me this weekend!\n </body>\n </note>"
_________________________________________________________________ Mailing list for the lxml Python XML toolkit - http://lxml.de/ lxml@lxml.de https://mailman-mail5.webfaction.com/listinfo/lxml

From: Brett mark grandi writes:
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 ...snip... add '--without-lzma' to that list, so it becomes
# build libxml2 libxml2_configure_cmd = configure_cmd + [ '--without-python', '--with-iconv=%s' % prefix, '--without-lzma'] ...snip...
I tried the following and it seems to work fine: lilliput:lxml-2.3.5 brett$ STATIC_DEPS=true sudo easy_install "lxml==2.3.5" lilliput:lxml-2.3.5 brett$ sudo python setup.py install lilliput:lxml-2.3.5 brett$ python
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 0x103b0cfa0> etree.tostring(x) "<note>\n <to>\n Tove\n </to>\n <from>\n Jani\n </from>\n <heading>\n Reminder\n </heading>\n <body>\n Don't forget me this weekend!\n </body>\n </note>"
Mark Grandi, 12.09.2012 09:25: My mistake, I should of clarified that this was for python 3. Easy_install works great but it doesn't run under python3...
You can (and should) use "pip" instead. However, that's not the thing that Brett meant here. Basically, what he's saying is that he can build lxml just fine on his side, which, I assume, also runs MacOS-X Lion. Stefan

Stefan Behnel <stefan_ml <at> behnel.de> writes:
You can (and should) use "pip" instead. However, that's not the thing that Brett meant here. Basically, what he's saying is that he can build lxml just fine on his side, which, I assume, also runs MacOS-X Lion.
Stefan
Yes, specifically I was striving for the "simplest" path that might help someone with Python 2.7.2, LXML 2.3.5 and Mountain Lion (10.8.1)... which is what I am running. I also just took the commands documented on the LXML site for installing on previous versions of Mac OS X, hence the easy_install. Sorry for the lack of contextual clarity.
participants (3)
-
Brett
-
Mark Grandi
-
Stefan Behnel