Pip reference broken

It seems there is something broken on the multipass install.
I’m trying out a super plain publish of a python based snap.
It fails trying to run pip.

Fetched 18.4 MB in 0s (0 B/s)
Get:1 libsqlite3-0_3.11.0-1ubuntu1.1_amd64.deb [396 kB]
Fetched 396 kB in 0s (0 B/s)
Get:1 python3.5_3.5.2-2ubuntu0~16.04.5_amd64.deb [165 kB]
Fetched 165 kB in 0s (0 B/s)
Get:1 python3_3.5.1-3_amd64.deb [8710 B]
Fetched 8710 B in 0s (0 B/s)
Get:1 python3.5-minimal_3.5.2-2ubuntu0~16.04.5_amd64.deb [1598 kB]
Fetched 1598 kB in 0s (0 B/s)
Get:1 mime-support_3.59ubuntu1_all.deb [31.0 kB]
Fetched 31.0 kB in 0s (0 B/s)
Get:1 libmpdec2_2.4.2-1_amd64.deb [82.6 kB]
Fetched 82.6 kB in 0s (0 B/s)
Get:1 libexpat1_2.1.0-7ubuntu0.16.04.3_amd64.deb [71.2 kB]
Fetched 71.2 kB in 0s (0 B/s)
Get:1 python3-minimal_3.5.1-3_amd64.deb [23.3 kB]
Fetched 23.3 kB in 0s (0 B/s)
Get:1 libpython3-stdlib_3.5.1-3_amd64.deb [6818 B]
Fetched 6818 B in 0s (0 B/s)
Get:1 dh-python_2.20151103ubuntu1.1_all.deb [74.1 kB]
Fetched 74.1 kB in 0s (0 B/s)
Get:1 libpython3.5-stdlib_3.5.2-2ubuntu0~16.04.5_amd64.deb [2134 kB]
Fetched 2134 kB in 0s (0 B/s)
Get:1 libpython3.5-minimal_3.5.2-2ubuntu0~16.04.5_amd64.deb [524 kB]
Fetched 524 kB in 0s (0 B/s)
Get:1 libssl1.0.0_1.0.2g-1ubuntu4.15_amd64.deb [1084 kB]
Fetched 1084 kB in 0s (0 B/s)
Pulling talki
no source pull
Building talki
/root/parts/talki/install/usr/bin/python3: No module named pip
/root/parts/talki/install/usr/bin/python3: No module named pip
Failed to run ‘/root/parts/talki/install/usr/bin/python3 -m pip list’: Exited with code 1.
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
An error occurred when trying to execute ‘sudo -i env SNAPCRAFT_HAS_TTY=True snapcraft snap’ with ‘multipass’: returned exit code 2.

I think it is a bug in the python plugin, try clean the python plugin part and rebuild again.

I’ve done ‘snapcraft clean’ 10+ times, is there another way to do that?

Can you share your snapcraft.yaml? It’s very hard to debug without seeing what you’re asking snapcraft to do

1 Like

I’m happy to write the snapcraft.yaml any way needed, if I can just get a basic Python script to run. I tried to write one based on examples that seemed to be supposed to work.
This is my current version

name: talki
version: git
description: >
Talki …

architectures: [all]
grade: devel
confinement: devmode

apps:
talki:
command: env PYTHONPATH=$SNAP/usr/lib/python3/dist-packages PREFIX=$SNAP GIT_EXEC_PATH=$SNAP/usr/lib/git-core LC_ALL=C.UTF-8 $SNAP/bin/talki
plugs: [network, network-bind, home]

parts:
desktop:
plugin: python
source: .
requirements: requirements.txt

the requirements.txt has one line

imutils==0.5.2