1

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?

Nben
  • 127
  • 7

2 Answers2

0

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).

Nben
  • 127
  • 7
0

I get the same bug on OpenWrt 19.x.x with python 3.7. But on previous versions, all works fine. So I just force removed libxml2 and libxslt libraries and reinstall them from the previous branch.

Kenly
  • 24,317
  • 7
  • 44
  • 60
gvvad
  • 1