Python agent error - RuntimeError: Failed to build Contrast C extension

  • Updated

Issue

Adding the Contrast Python agent to a project fails with build errors like:

RuntimeError: Failed to build Contrast C extension.
It is necessary for autotools (autoconf, automake) to be installed in order for
Contrast to build properly. On lightweight systems such as Alpine, it may be
necessary to install linux-headers if they are not available already. Some
other systems may require "build essential" packages to be installed.

The contrast-agent.log may also list the following error:

configure: error: C compiler cannot create executables
See `config.log' for more details


Cause

This is likely a system issue on systems running Mac OS with the installation/configuration of the XCode C libraries.


Resolution

To install XCode C libraries, run

xcode-select --install

and ensure proper XCode tools are available.

Next, run

gcc

and ensure the license has been accepted.


If this does not address the problem, please collect the pip config.log.

To prevent pip from cleaning up the temporary buld directory, it may be required to run pip install with the --no-clean option in order to retrieve the config.log.</class="note></class="note">

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request