Snap command doesn't open my app (File not found error)

Hi,

I’m attempting to make and run my first Snap package.
My program is written in Python 3 with GTK3 and uses a module called Pillow.

The snap gets created and installed, but when I attempt to run the app, the error is:
/snap/openresizer/x1/bin/desktop-launch: line 545: /snap/openresizer/x1/bin/openresizer.py: No such file or directory

I’m obviously doing something wrong. I don’t even see any .py python files in the final snap/openresizer folder, after my snap has been installed.

I believe the issue is here:
command: desktop-launch $SNAP/bin/openresizer.py

I don’t actually see ‘openresizer.py’ in the final snap package, after it’s installed.

Any help would be appreciated.

My snapcraft.yaml file is as follows:

name: openresizer # you probably want to 'snapcraft register <name>'
#base: core18 # the base snap is the execution environment for this snap
version: '1.0' # just for humans, typically '1.2+git' or '1.3.2'
summary: Batch image resizer with a GUI # 79 char long summary
description: |
  OpenResizer is an open-source batch image resizing software with a GUI.
  It is designed to be fast and easy-to-use.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

icon: gui/icon.png

build-packages:
    - python3

parts:
  openresizer:
    # See 'snapcraft plugins'
    plugin: python
    python-version: python3
    source: https://github.com/jrezai/openresizer.git
    after: [desktop-gtk3]
    stage-packages:
    - python3-pil
    - python3-gi
    - gir1.2-gtk-3.0
    - gir1.2-gdkpixbuf-2.0


plugs:
  gtk-3-themes:
    interface: content
    target: $SNAP/share/themes
    default-provider: gtk-common-themes:gtk-3-themes
  icon-themes:
    interface: content
    target: $SNAP/share/icons
    default-provider: gtk-common-themes:icon-themes
  sound-themes:
    interface: content
    target: $SNAP/share/sounds
    default-provider: gtk-common-themes:sounds-themes

apps:
  openresizer:
    command: desktop-launch $SNAP/bin/openresizer.py
    plugs:
    - x11
    - unity7
    - pulseaudio
    - wayland
    - desktop
    - gsettings
    - home

Run find prime -name 'openriser.py' in a terminal, after changing the working directory to the snapcraft execution directory

1 Like

Thanks, I looked in the ‘Snap’ folder, where other snaps are installed, and in my app’s snap folder, there is no ‘openresizer.py’. I’m not sure why the Python files for my app are not being included.

have you found a solution to that ?