Comment 0 for bug 1802345

Alberto Donato (ack) wrote :

Building python packages that have C modules fails with snapcraft as C headers are not found.

This is a sample snaps that fails building on Bionic:

name: test
version: 1.0
summary: test
description: test
grade: stable
confinement: strict
base: core18

apps:
  uwsgi:
    command: uwsgi

parts:
  uwsgi:
    plugin: python
    source: .
    python-packages:
      - uWSGI
    build-packages:
      - python3-dev
    stage-packages:
        - libpython3.6

exporting C_INCLUDE_PATH=/usr/include/python3.6 makes it work.

Tested with both stable (2.43.1) and candidate (3.0) snaps.

Also, removing the core18 base and using libpython3.5 when building on xenial shows the same issue