Unfortunately a lot has changed in the Snapcraft world and I am having a little trouble figuring out things.
I am having the following error when running the snap:
$ eri0o-drawing.drawing
Traceback (most recent call last):
File "/snap/eri0o-drawing/x1/usr/bin/drawing", line 36, in <module>
import gi
ModuleNotFoundError: No module named 'gi'
But I am staging the python-gi package… This package builds with meson instead of having a setup.py.
I noticed the software also includes a deb builder script so maybe it should be used instead and in some way have that deb inside the snap, but I don’t know how to do it either.
(I tried to use a python part, but then I get ModuleNotFoundError: No module named 'distutils.util' right at start when it tries to install pip)
I did found someone on the forums with problems that I am not sure are relevant: Importing PIL and gi into a Snap , unfortunately, no working snapcraft.yaml file.
My system details:
$ lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
$ uname -a
Linux 4.15.0-55-generic #60-Ubuntu SMP
Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ snapcraft --version
snapcraft, version 3.7.1
@ericoporto2008 I also encountered the same issues but couldn’t solve them either (although I didn’t spend a lot of time trying) - so is good to have @kenvandine on the case - I am leaving it to the expert so will be intriuged to find out how he ends up solving it The big issue I had was it uses Gtk.Template which is only in newer versions of PyGObject (so the version in python3-gi in bionic is not new enough so just a stage-packages of it is not enough) - this likely needs to be built from source explicitly as a separate part.
Ah, damn, good information. For some reason pip directly instead of the Python packages from the Ubuntu repo gave me errors when using snapcraft (the distutils error above).
About the staging, when I mounted the snap by either installing or as it’s indicated here I do SEE the Python modules there, so it’s some environment thing the reason Python is failing, like it’s using the Python from machine directly or the Python in the snap has the wrong env.
Could you share your snapcraft.yaml even if didn’t worked out?
You can find my attempt at https://github.com/alexmurray/drawing-snap - I didn’t end up committing the bits where I experimented with the python plugin to define an extra part for a newer PyGObject so it doesn’t actually work at all as is (well it builds but fails to launch with the same ModuleNotFoundError: No module named 'gi' error as you got - AND if you try launch it directly via /snap/drawing/current/usr/bin/drawing it gets further but fails since python3-gi is not new enough so Gtk.Template doesn’t exist).
This needs enough stuff that’s newer than what’s in bionic that it’s turned into a great test case for the new gnome-3-32-1804 build and content snaps. We found a couple things that we needed to add to the build snap then I’ll be able to finish this snap. Stay tuned!
I’ll submit a PR upstream, but not until all the various pieces are in place. Right now you need to manually install the new gnome-3-32-1804 content snap and connect it’s interfaces. That snap should make it to stable in the next couple of weeks.
Yes and no. The snap is fine, but it uses the gnome-3-32-1804 runtime which has not be published to stable yet. Therefore it won’t be installed and connected automatically. Once we get that published to stable I’ll publish drawing to stable.
I’ve installed - but the snap crashes - when running I see the following message:
snap run drawing
Gtk-Message: 22:16:19.039: Failed to load module "canberra-gtk-module"
(com.github.maoschanz.drawing:10525): Gtk-WARNING **: 22:16:19.247: Attempting to add a widget with type GtkFlowBox to a container of type GtkBox, but the widget is already inside a container of type GtkBox, please remove the widget from its existing container first.
activation du panneau …
… panneau activé
free(): invalid pointer
Aborted (core dumped)
snap list drawing
Name Version Rev Tracking Publisher Notes
drawing 0+git.33155c2 9 stable ken-vandine -
Kind of odd - I’m using english GB locale - Ubuntu Budgie 18.04