According to the docs: The python plugin
Use of python3- in stage-packages will force the inclusion of the python interpreter.
If I create the following over simplified
name: test-thing base: core20 version: '0.0.0' summary: Test thing description: | ..for testing _things_ grade: devel confinement: devmode apps: test-thing: command: bin/test-thing environment: GI_TYPELIB_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/girepository-1.0 parts: test-thing: plugin: dump source: test-thing organize: test-thing : bin/ python-deps: plugin: python stage-packages: - python3-gi - gir1.2-snapd-1
I should get a copy of python included in my snap as far as I understand.
However, it does not inlcude the interpret, but a symlink that resolves to the base snap. Hence, modules are not loaded from the
dist-packages in the snap.
This is how the snap looks if I shell into the snap using
snap run --shell test-thing :
root@ubuntu:~# which python3 /snap/test-thing/x2/bin/python3 root@ubuntu:~# ls -al /snap/test-thing/x2/bin/python3 lrwxrwxrwx 1 root root 16 Oct 13 20:20 /snap/test-thing/x2/bin/python3 -> /usr/bin/python3
Any idea what’s going on and how I can fix this ?