[lxml-dev] Problem installing lxml-2.0beta1 onto production server
I am installing lxml-2.0beta1 on python 2.3 on RHEL4. I brought my libxml2 and libxslt up to date: libxml2-2.6.30-1 libxslt-1.1.22-1 then easy-install -U lxml During the install process, I got this: easy_install-2.3 -U lxml Searching for lxml Reading http://pypi.python.org/simple/lxml/ Reading http://codespeak.net/lxml Best match: lxml 2.0beta1 Downloading http://cheeseshop.python.org/packages/source/l/lxml/lxml-2.0beta1.tar.gz Processing lxml-2.0beta1.tar.gz Running lxml-2.0beta1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-SE9_WX/lxml-2.0beta1/egg-dist-tmp-onxV0q Building lxml version 2.0.beta1. NOTE: Trying to build without Cython, pre-generated 'src/lxml/etree.c' needs to be available. warning: no previously-included files found matching 'doc/pyrex.txt' warning: no previously-included files found matching 'src/lxml/etree.pxi' File "build/bdist.linux-i686/egg/lxml/html/diff.py", line 323 start.extend(tag for name, pos, tag in tag_stack) ^ SyntaxError: invalid syntax File "/usr/local/lib/python2.3/site-packages/lxml-2.0beta1-py2.3-linux-i686.egg/lxml/html/diff.py", line 323 start.extend(tag for name, pos, tag in tag_stack) ^ SyntaxError: invalid syntax Adding lxml 2.0beta1 to easy-install.pth file Installed /usr/local/lib/python2.3/site-packages/lxml-2.0beta1-py2.3-linux-i686.egg Processing dependencies for lxml Finished processing dependencies for lxml And when I try to run an application that uses lxml, I get this: @400000004793fafb29d86124 Traceback (most recent call last): @400000004793fafb29e1c764 File "/misc/home/bkc/src/Python/MurkWorks/Rating/RatingServer.py", line 13, in ? @400000004793fafb29e2b994 from MurkWorks.Carriers.Rater import Rater, get_carrier_service_mapper @400000004793fafb29ee36fc File "/misc/home/bkc/src/Python/MurkWorks/Carriers/Rater.py", line 22, in ? @400000004793fafb29eee2dc import UPS, BAX, CCX, Estes, FedexFreight, FedexExpress, FedexGround, USPS, Yellow, Aaction, LandAir, FedexNational, CentralTransport @400000004793fafb29f3d094 File "/misc/home/bkc/src/Python/MurkWorks/Carriers/CentralTransport.py", line 14, in ? @400000004793fafb29f4a76c from lxml import etree @400000004793fafb29f55734 ImportError: /usr/local/lib/python2.3/site-packages/lxml-2.0beta1-py2.3-linux-i686.egg/lxml/etree.so: undefined symbol: PyDict_Contains On my development server I'm running alpha3, so I'm trying to to install that now: http://cheeseshop.python.org/packages/source/l/lxml/lxml-2.0alpha3.tar.gz But that fails:: NOTE: Trying to build without Cython, pre-generated 'src/lxml/etree.c' needs to be available. warning: no previously-included files found matching 'doc/pyrex.txt' warning: no previously-included files found matching 'src/lxml/etree.pxi' src/lxml/etree.c:73843: error: `METH_COEXIST' undeclared here (not in a function) src/lxml/etree.c:73843: error: initializer element is not constant src/lxml/etree.c:73843: error: (near initialization for `__pyx_methods_5etree_QName[0].ml_flags') src/lxml/etree.c:73843: error: initializer element is not constant src/lxml/etree.c:73843: error: (near initialization for `__pyx_methods_5etree_QName[0]') same error with alpha4 Oops, and alpha5 is: Building lxml version 2.0.alpha5. NOTE: Trying to build without Cython, pre-generated 'src/lxml/etree.c' needs to be available. warning: no previously-included files found matching 'doc/pyrex.txt' warning: no previously-included files found matching 'src/lxml/etree.pxi' File "build/bdist.linux-i686/egg/lxml/html/diff.py", line 323 start.extend(tag for name, pos, tag in tag_stack) ^ SyntaxError: invalid syntax File "/usr/local/lib/python2.3/site-packages/lxml-2.0alpha5-py2.3-linux-i686.egg/lxml/html/diff.py", line 323 start.extend(tag for name, pos, tag in tag_stack) ^ SyntaxError: invalid syntax Adding lxml 2.0alpha5 to easy-install.pth file Installed /usr/local/lib/python2.3/site-packages/lxml-2.0alpha5-py2.3-linux-i686.egg Processing dependencies for lxml==2.0alpha5 Finished processing dependencies for lxml==2.0alpha5 It looks like it's going to be a late night for me re-writing to not use lxml on the production server. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com AOL-IM: BKClements
On Sun, Jan 20, 2008 at 09:03:33PM -0500, Brad Clements wrote:
File "build/bdist.linux-i686/egg/lxml/html/diff.py", line 323 start.extend(tag for name, pos, tag in tag_stack) ^ SyntaxError: invalid syntax
This looks like your server uses an older Python version. "(tag for name, pos, tag in tag_stack)" is a generator expression, which was introduced in Python 2.4. Regards, Albert
Hi,
I am installing lxml-2.0beta1 on python 2.3 on RHEL4.
I didn't check 2.3 compatibility for a while (Ubuntu doesn't have Python 2.3 anymore), looks like things got a bit out of hand here. I fixed etree for now, it should be in SVN by tonight (CET). You should be fine with that version. Note that building it will require Cython 0.9.6.11 or later. The doctestcompare stuff will not work with Python 2.3, so I had to disable the doctests for that version. Looks like there's still a bit more to do, though. Stefan
participants (3)
-
Albert Brandl
-
Brad Clements
-
Stefan Behnel