pythonxsltlxmlpyquery

undefined symbol: xsltGetProfileInformation while importing pyquery


I'm trying to use pyquery on Python 3.8.3, and fail due to:

>>> import pyquery
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/lib/python3.8/site-packages/pyquery/__init__.py", line 7, in <module>
    from .pyquery import PyQuery  # NOQA
  File "/opt/lib/python3.8/site-packages/pyquery/pyquery.py", line 11, in <module>
    from lxml import etree
ImportError: /opt/lib/python3.8/site-packages/lxml/etree.cpython-38.so: undefined symbol: xsltGetProfileInformation

the OS is CoreELEC, so no "apt-get", but only "opkg install" like in OpenWRT.

tried reinstalling both lxml and pyquery, but it didn't work. where is the issue?


Solution

  • figured it out eventually. the system only has "opkg install" way of installing packages. python3-lxml package was already installed, along with libxml2. I had to also install libxslt for it to work. so eventually the steps are:

    opkg install python3-lxml
    opkg install libxml2
    opkg install libxslt
    

    and now I'm able to import pyquery (which uses etree from lxml).