Travis Fails - error: command 'gcc' failed with exit status 1

Hi,
Has anyone seen this error ? if yes. How did you fix this issue.

Complete output from command /home/travis/virtualenv/python3.6.5/bin/python -u -c “import setuptools, tokenize;file=’/tmp/pip-install-720da4tr/google-crc32c/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” bdist_wheel -d /tmp/pip-wheel-1a89miq2 --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/google_crc32c
copying src/google_crc32c/python.py → build/lib.linux-x86_64-3.6/google_crc32c
copying src/google_crc32c/_checksum.py → build/lib.linux-x86_64-3.6/google_crc32c
copying src/google_crc32c/config.py → build/lib.linux-x86_64-3.6/google_crc32c
copying src/google_crc32c/init.py → build/lib.linux-x86_64-3.6/google_crc32c
copying src/google_crc32c/cext.py → build/lib.linux-x86_64-3.6/google_crc32c
running build_ext
building ‘google_crc32c._crc32c’ extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
creating build/temp.linux-x86_64-3.6/src/google_crc32c
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -I/opt/python/3.6.5/include/python3.6m -c src/google_crc32c/_crc32c.c -o build/temp.linux-x86_64-3.6/src/google_crc32c/_crc32c.o
src/google_crc32c/_crc32c.c:3:27: fatal error: crc32c/crc32c.h: No such file or directory
compilation terminated.
error: command ‘gcc’ failed with exit status 1


Failed building wheel for google-crc32c

It’s hard to say without seeing your .travis.yml,

Try upgrading your pip version.

sudo pip3 install --upgrade pip

https://app.travis-ci.com/github/vidahealth/airflow/jobs/534670959

Here is my travis,yml

language: python

python:
- 3.6.5

env:
  global:
  - CLOUDSDK_PYTHON=python3
  - GCS_UPLOAD_DIR='dags'
  - LOCAL_DAGS_DIR='dags'

jobs:
  include:
    
    - stage: build docker image
      script:
      # qa pipeline
      - pip install -r projects/qa/requirements.txt 
      - docker build -t us.gcr.io/$DOCKER_IMAGE_NAMESPACE/$DOCKER_QA_IMAGE_JOB:$TRAVIS_COMMIT -f projects/qa/Dockerfile .
      - echo $SERVICE_ACCOUNT > service_account_info.json
      - bash deploy/deploy.sh $DOCKER_IMAGE_NAMESPACE $DOCKER_QA_IMAGE_JOB $TRAVIS_COMMIT service_account_info.json


    - stage: deploy
      script: skip
      deploy:
       provider: gcs
       access_key_id: 
       secret_access_key:
         secure: 
       bucket: "$GCS_BUCKET"
       upload_dir: "$GCS_UPLOAD_DIR"
       local_dir: "${TRAVIS_BUILD_DIR}/${LOCAL_DAGS_DIR}"
       on:
        branch:
        - master
        - release 

Try adding:

sudo apt-get install python36-devel # if debian based distro 
pip install pycocotools
pip install external/detectron2

apparently, crc32c needs to be available in the src directory.
<…>
Looks like a repo can reference anther repo.
<…>
git clone --recursive solved the problem.

Looks like you need to add that crc32c C library as a submodule to your repo into the src directory.
Travis checks out submodules automatically by default.

Imprint