Saxonc python extension issue with macOs

215 views Asked by At

I am trying to install saxonC extension for python in mac OS for xml transformation using xsl and i am getting the below error when i run "python3 saxon-setup.py build_ext -if" as mentioned in the documentation here: https://www.saxonica.com/saxon-c/documentation11/index.html#!starting/installingpython

Error: clang: error: no such file or directory: '../DocumentBuilder.cpp' clang: error: no input files error: command '/usr/bin/clang' failed with exit code 1

2

There are 2 answers

9
ond1 On

Run the following command to escape the unsigned library issue:

xattr -d -r com.apple.quarantine libsaxon-HEC-11.3/libsaxonhec.dylib

The SaxonC libsaxonhec.dylib library is an x86_64 file. Therefore the executables for the samples, Python and PHP extension also need to be built as an x86_64 file.

The following command for building the SaxonC python extension should work:

arch -x86_64 python3 saxon-setup.py build_ext -if

Unfortunately python3 needs to be run as x86_64:

arch -x86_64 python3 saxon_example3.py

0
ond1 On

SaxonC 12.0 now supports M1 chip. Also SaxonC is available as a Pypi package which will make installation easier. See: https://pypi.org/user/saxonica/