Snapcraft not working on Ubuntu 17.10


#1

Hello everyone,

I’m new to snap and snapcraft and I’m struggling to get snapcraft running on Ubuntu 17.10 with a python part.
I am using the following snapcraft.yaml file for a normal python project (similar to https://docs.snapcraft.io/build-snaps/python):

name: test-device
version: "0.1"
summary: Test-Device
description: Test
grade: devel
confinement: devmode
apps:
  test-device:
  command: bin/test-device
parts:
  test-device:
  plugin: python
  python-version: python2
  source: .

… and I’m always running in the error when priming:

Priming cavi-device
Traceback (most recent call last):
File “/snap/snapcraft/1094/bin/snapcraft”, line 11, in
load_entry_point(‘snapcraft==2.39’, ‘console_scripts’, ‘snapcraft’)()
File “/snap/snapcraft/1094/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/snap/snapcraft/1094/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 2631, in load_entry_point
return ep.load()

/_snap_packaging.py", line 512, in _wrap_app
app[k] = self._wrap_exe(app[k], ‘{}-{}’.format(k, name))
File “/snap/snapcraft/1094/lib/python3.6/site-packages/snapcraft/internal/meta/_snap_packaging.py”, line 482, in _wrap_exe
with open(exepath, ‘rb’) as exefile:
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/florian/Desktop/snaptest/prime/bin/test-device’

Could you give me any hint what the problem might be.
Thanks a lot,
Florian


#2

Your problem is indicated by this line:

Specifically the command you’ve specified to be run when a user uses your snap doesn’t exist where you’ve said it will be once the build is complete. It’s most-likely just a case of being somewhere else than bin.


#3

Hello Daniel,
I found the problem: I just used a python project without any executable script for trying snapcraft out. After defining a script in the setup.py of the project and referencing to it in the correct way in the command, everything is working out correctly.
Thanks,
Florian