Pypy3 lxml support - please help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Pypy3 lxml support - please help

Michal Moiseev
Hi,
In our firm we are developing on python 3.4, and from performance issues, we have been trying to see if we we can run our code with pypy3,
I couldn't seem to fine a solution for the lxml package, the pypy implementation - lxml-cffi is only for python 2.x, and when installing lxml, it is also seems to work only for python 2.x, and the following error is printed when trying to import:
  from lxml import etree
  File "src/lxml/xmlschema.pxi", line 22, in init lxml.etree (src/lxml/lxml.etree.c:231895)
  File "src/lxml/xpath.pxi", line 420, in lxml.etree.XPath.__init__ (src/lxml/lxml.etree.c:173999)
  File "src/lxml/xpath.pxi", line 150, in lxml.etree._XPathEvaluatorBase.set_context (src/lxml/lxml.etree.c:170398)
  File "src/lxml/xpath.pxi", line 66, in lxml.etree._XPathContext.set_context (src/lxml/lxml.etree.c:169176)
  File "src/lxml/extensions.pxi", line 255, in lxml.etree._BaseContext.registerLocalFunctions (src/lxml/lxml.etree.c:160400)
AttributeError: 'dict' object has no attribute 'iteritems'
thank you!


--


_______________________________________________
pypy-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/pypy-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pypy3 lxml support - please help

Armin Rigo-2
Hi Michal,

On 30 July 2017 at 13:53, Michal Moiseev <[hidden email]> wrote:
I couldn't seem to fine a solution for the lxml package, the pypy implementation - lxml-cffi is only for python 2.x, and when installing lxml, it is also seems to work only for python 2.x, and the following error is printed when trying to import:

This used to be a known problem with Cython: https://github.com/cython/cython/pull/1631 .  It has been fixed in Cython 0.26.  The issue here is that lxml comes with pre-Cythonized files produced by Cython 0.25.2.

Apart from waiting for the next release of lxml, you could manually install lxml.  To do so, download the source, and run:

    pypy3 -m pip install cython
    pypy3 setup.py build --with-cython      # forced re-Cythonize
    pypy3 setup.py install


A bientôt,

Armin.

_______________________________________________
pypy-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/pypy-dev