TOSIT-IO / tdp-collection-prerequisites

Ansible collection with TDP prerequisites
Apache License 2.0
3 stars 10 forks source link

Rocky 8: Python "lxml" library is required #58

Closed kpgtek closed 1 year ago

kpgtek commented 1 year ago

On Rocky 8, tdp deploy failes in few tasks with the error message "Failed to import the required Python library (lxml)".

There are 4 packages for Python lxml library provided from the appstream repository:

[root]# dnf search *lxml*
[...]
python2-lxml.x86_64 : XML processing library combining libxml2/libxslt with the ElementTree API
python3-lxml.x86_64 : XML processing library combining libxml2/libxslt with the ElementTree API
python38-lxml.x86_64 : XML processing library combining libxml2/libxslt with the ElementTree API
python39-lxml.x86_64 : XML processing library combining libxml2/libxslt with the ElementTree API
[...]

I have tested with the installation of python3-lxml package, it seems this works and is compatible with Python v3.6 installed on my system:

[root]# repoquery --list python3-lxml
[...]
/usr/lib64/python3.6/site-packages/lxml
/usr/lib64/python3.6/site-packages/lxml-4.2.3-py3.6.egg-info
[...]
[root]# python3 --version
Python 3.6.8
rpignolet commented 1 year ago

This is a bug for tdp-lib you should not install python package for tdp-lib because it use a python virtual env for deployment.

gboutry commented 1 year ago

This is not a bug for tdp-lib, lxml is required for merging task in ranger role

rpignolet commented 1 year ago

So this is not a tdp deploy bug, this is an Ansible tasks bug.

kpgtek commented 1 year ago

With CentOS 7 using Python2 by default, the package python-lxml is already installed by default. Now with Rocky 8 using Python3, this package is not installed by default. Perharps it is needed to add it explicitly in tdp-collection-prerequisites, but this package exists for different versions of Python3.

rpignolet commented 1 year ago

Yes we should install the python3-lxml. Ansible use the default python 3 on Rocky 8.