Building python snaps
Hi all I’m getting really frustrated. I’m trying to build a python application using base: core18
but it won’t build. For some reason multipass isn’t really used during the build? What is going wrong here?
name: gh-teacher-tools
base: core18
version: git
summary: gh-teacher-tools helps teachers manage courses and exams that use GitHub.
description: >
gh-teacher-tools helps teachers manage courses and exams that use GitHub.
confinement: strict
parts:
gh-teacher-tools:
plugin: python
python-version: python3
source: .
requirements: requirements.txt
stage-packages:
- git
- ssh
locales-launch:
# Remote part to get proper locale support.
# More info: https://forum.snapcraft.io/t/the-locales-launch-remote-part/8729
apps:
gh-teacher-tools:
command: locales-launch $SNAP/usr/bin/python3 $SNAP/bin/gh-teacher-tools
plugs:
- home
- network
- ssh-keys
$ snapcraft
Hit http://ftp.belnet.be/ubuntu.com/ubuntu cosmic InRelease
Hit http://ftp.belnet.be/ubuntu.com/ubuntu cosmic-updates InRelease
Hit http://ppa.launchpad.net/webupd8team/java/ubuntu cosmic InRelease
Hit http://ftp.belnet.be/ubuntu.com/ubuntu cosmic-backports InRelease
Hit http://ftp.belnet.be/ubuntu.com/ubuntu cosmic-security InRelease
Hit https://jfed.ilabt.imec.be/deb-repo stable InRelease
Hit http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu bionic InRelease
Fetched 0 B in 0s (0 B/s)
Removing suid/guid from /home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/usr/lib/openssh/ssh-keysign
Pulling gh-teacher-tools
Fetching and installing pip...
Collecting pip
Using cached https://files.pythonhosted.org/packages/d7/41/34dd96bd33958e52cb4da2f1bf0818e396514fd4f4725a79199564cd0c20/pip-19.0.2-py2.py3-none-any.whl
Saved ./parts/gh-teacher-tools/python-packages/pip-19.0.2-py2.py3-none-any.whl
Successfully downloaded pip
Collecting pip
Installing collected packages: pip
Successfully installed pip-19.0.2
Traceback (most recent call last):
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/_internal/__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/_internal/cli/cmdoptions.py", line 14, in <module>
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils.util'
Traceback (most recent call last):
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/_internal/__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/lib/python3.6/site-packages/pip/_internal/cli/cmdoptions.py", line 14, in <module>
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils.util'
Failed to run '/home/merlijn/PHD/SYSPROG/gh-teacher-tools/parts/gh-teacher-tools/install/usr/bin/python3 -m pip list': Exited with code 1.