1

On my Mac (OSX 10.15.7) I try to install something using pip3:

pip3 install ovirt-engine-sdk-python

I get a GCC error:

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/usr/local/opt/ruby/include -I/usr/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c ext/ov_xml_reader.c -o build/temp.macosx-10.9-x86_64-3.9/ext/ov_xml_reader.o
    ext/ov_xml_reader.c:20:10: fatal error: 'libxml/xmlreader.h' file not found
    #include <libxml/xmlreader.h>
             ^~~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command '/usr/bin/gcc' failed with exit code 1

I suspect this has something to do with where the C headers are located, and GCC nog finding them...

The suggestion to work around this is to do:

export CPATH=`xcrun --show-sdk-path`/usr/include

But this does not work. I keep getting the error.

How do I get this to work?

1 Answer 1

1

I found out that this would work:

pip3 install --global-option=build_ext  --global-option="-I`xcrun --show-sdk-path`/usr/include/libxml2" ovirt-engine-sdk-python

This specifically adds the path to libxml2 to the include path. How to solve this in a more general way I do not know however.

3
  • More general use a p[ackage manager like macports or homebrew - these are general purpose - in this case they would install libxml2 as well as the python bits. If your main language is just python then I would use conda as it is python based and has special cases and integration for python
    – mmmmmm
    Apr 22, 2021 at 16:25
  • Homebrew has its own issues though. It keeps the python environments of different applications separately. Which is an issue when you are installing ovirt-engine-sdk to use it with ansible... May 12, 2021 at 6:48
  • OK then use conda as it understands python fuilly
    – mmmmmm
    May 12, 2021 at 8:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .