VOOZH about

URL: https://repost.aws/questions/QUSLtcKK0NQ7eMQF7Jr4Lw8A/dag-import-error-from-lxml-import-etree-mwaa

⇱ DAG Import Error from lxml import etree MWAA | AWS re:Post


Skip to content

DAG Import Error from lxml import etree MWAA

0

When DAG executes the followin importfrom simple_salesforce import Salesforce an import error occurs:

Broken DAG: [/usr/local/airflow/dags/example_dag_with_taskflow_api.py] Traceback (most recent call last):
 File "/usr/local/airflow/.local/lib/python3.11/site-packages/zeep/transports.py", line 11, in <module>
 from zeep.utils import get_media_type, get_version
 File "/usr/local/airflow/.local/lib/python3.11/site-packages/zeep/utils.py", line 5, in <module>
 from lxml import etree
ImportError: libxslt.so.1: cannot open shared object file: No such file or directory

The requirements.txt I am using on aws-mwaa-local-runner is the same as what I imported into S3 bucket. The local runner environment does not have the import error. Both are using Airflow version 2.7.2 (latest) and python version 3.11

1 Answer
  • Newest
  • Most votes
  • Most comments
Are these answers helpful? Upvote the correct answer to help the community benefit from your knowledge.
0

Based on the ImportError: libxslt.so.1: cannot open shared object file: No such file or directory error message above, DAG parsing is failing due to the fact it's unable to find the shared object binary "libxslt". Similar issues have occurred when upgrading, and one solution has been to supply the "libxslt-devel" via a startup script to get installed in the environment during update process -

startup.sh script:

#!/bin/sh

echo "Updating operating system"
sudo yum install -y libxslt-devel

let me know how it goes

answered 2 years ago

SUPPORT ENGINEER

reviewed 2 years ago