Failed to build a snap (command is not executable)

Hi all,

I’m trying to build a snap of a small project I’ve been working on with some friends, a python app hosted on github. I have a python file called run, in a directory called bin, which is what I would like to expose to the system. The issue is that snapcraft exits with the error Failed to generate snap metadata: The specified command 'bin/run' defined in the app 'pyplane' is not executable.

I’m not sure what I’m doing wrong, so any help would be much appreciated.

The project is hosted at

This is my snapcraft.yaml:

name: pyplane
summary: PyPLANE
  An open source replacement to the traditional DFIELD and PPLANE applications for solving systems of ODEs
base: core18
version: "git"

    source: .
    source-branch: snap_testing
    plugin: python
    python-version: "python3"
      - numpy
      - sympy
      - scipy
      - matplotlib
      - pyqt5
    command: bin/run

confinement: strict

and bin/run:

#!/usr/bin/env python3

import sys
from PyQt5.QtWidgets import QApplication
from PyPLANE.ui_main_window import MainWindow

app = QApplication(sys.argv)
app_main_window = MainWindow()

Steps I take building the snap from scratch

  • Clone the repo
  • git checkout snap_testing (The branch I’m using to try and build the snap)
  • run snapcraft

There’s a few issues here.

These dependencies can be satisfied via additional parts or content sharing. Consider validating configured filesets if this dependency was built.
'grade' property not specified: defaulting to 'stable'.
The command 'bin/run' was not found in the prime directory, it has been changed to 'bin/run'.
Failed to generate snap metadata: The specified command 'bin/run' defined in the app 'pyplane' is not executable.
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.

The bin/run isn’t being staged - note the line above the . Where does it come from? How are you including it in the snap.
There is an error above the one you mention about bin/run not actually being in the snap.
Also, there’s a bunch of stage-packages listed in the snapcraft output, which need staging for a graphical application to work.
Finally you may need to use the desktop-qt5 launcher.

Thanks for the tips. After reading your response and looking at some examples I found out that I need to list bin/run under scripts in The snap builds, but as you pointed out there’s other issues. I should be able to figure those out though. Thanks for your help.

1 Like