I am in the process of developing and building my first snap and I started with the
devmode confinement for it and got it working. I then switched it to classic confinement (because the snap requires access to a wide variety of devices under
/dev to do its job). However, I get a
ModuleNotFoundError exception for the python module of the application being snapped.
Below is the
snapcraft.yaml that I have created.
name: glucometerutils summary: A command-line utility to interact with glucometers. description: | This provides a command-line utility to interact with a number of blood sugar meters (glucometers) models from various manufacturers. adopt-info: glucometerutils grade: stable confinement: classic base: core20 architectures: - build-on: [amd64] run-on: [amd64] apps: glucometer: command: bin/glucometer plugs: - block-devices - hidraw - raw-input - raw-usb - removable-media - scsi-generic - serial-port parts: glucometerutils: source: https://github.com/glucometers-tech/glucometerutils.git override-pull: | snapcraftctl pull snapcraftctl set-version "$(git rev-parse HEAD | cut -c -10)" plugin: python python-packages: - attrs - construct - crcmod - freestyle-hid>=1.0.2 - hidapi - PYSCSI[sgio]>=2.0.1 - pyserial[cp2110]>=3.5b0
The exception that I am getting only with the
classic mode build is
Traceback (most recent call last): File "/snap/glucometerutils/x1/bin/glucometer", line 5, in <module> from glucometerutils.glucometer import main ModuleNotFoundError: No module named 'glucometerutils'
I do not see this error when building the snap with
devmode confinement. I am not sure if I am missing anything obvious here. Help!