I am trying to get a simple PyQt5 application running on snap. But it’s running into problems. The snap gets created but I get an error at runtime:
This application failed to start because it could not find or load the Qt platform plugin “xcb”
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Reinstalling the application may fix this problem.
This is my snapcraft.yaml:
name: testpyqt version: '0.1' summary: test application using PyQt5 description: | A test application using PyQt5 and snapcraft packaging. grade: devel confinement: strict #base: core18 apps: testpyqt: command: testPyQtApp.py plugs: ['desktop', 'framebuffer', 'camera', 'network', 'home', 'opengl', 'x11'] parts: mainapp: after: [desktop-qt5] plugin: python python-version: python3 source: . requirements: requirements.txt readonlydata: after: [mainapp] plugin: dump source: readonly organize: '*' : $SNAP_DATA/readonly/
I have run it under a container using snapcraft cleanbuild (since I am running a 18.04 box) and the snap builds fine. I get this error regarding xcb at runtime.
If I use core18 instead I get the following error:
Failed to fetch stage packages: Error downloading packages for part ‘desktop-qt5’: The package ‘appmenu-qt5’ was not found…
From what I read on the posts, using “after: [desktop-qt5]” should allow me to build an app for PyQt5. Could someone please confirm this.
I also pip installed the package and ran it inside a virtualenv in an lxc container with 16.04. Then I sshd to the machine and I was able to run the application and see the GUI. So it seems the problem is only in the actual packaging of the snap, and I have missed adding something in.
Any help would be greatly appreciated.