The problem you’re hitting is that you’re telling snapcraft that you have a Python project, but you actually have a couple of scripts written in Python. You have a couple of options
use setuptools and friends to create a Python project, then try snapping it using the python plugin
Keep the simple nature of your scripts, and use the dump plugin with e.g.
stage-packages:
I can now build successfully and install but when I run “pihole-panel” I receive the error “/snap/pihole-panel/30/command-pihole-panel.wrapper: 6: exec: /snap/pihole-panel/30/bin/pihole-panel: Permission denied”
Now I’m sort of aware I may have to stage my python files? but taking it a step at a time so I placed an echo in the bash script to determine if the error is indeed caused by the bash script and not something it calls and it definitely cannot access the bash script.
I’m now getting this error when I run the application:
Traceback (most recent call last):
File "/snap/pihole-panel/41/bin/../pihole-panel/main.py", line 8, in <module>
gi.require_version('Gtk', '3.0')
File "/snap/pihole-panel/41/usr/lib/python3/dist-packages/gi/__init__.py", line 102, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
I have smart searched GitHub for everyone who is using Python/GTK in their apps and this is the most complete list I could compile and also no one is using fancy tricks in their YAML to make it work.
if you want to use GTK3 from your application then it is strongly recommended to depend on the desktop-gtk3 part and use the desktop-launch helper:
parts:
wrapper:
after: [desktop-gtk3]
... # the rest of your part here
apps:
pihole-panel:
command: desktop-launch $SNAP/bin/pihole-panel
desktop: ... # you need a .desktop file either in your snap whose path in your snap is written here, or
# omit this statement and make sure there is a file in your source at snap/gui/pihole-panel.desktop
plugs:
- desktop
- x11
- wayland