i am trying to build snap from my code for only test purpose. After running snapcraft command from project directory, i am getting this kind of error…
This snapcraft project does not specify the base keyword, explicitly setting the base keyword enables the latest snapcraft features.
This project is best built on 'Ubuntu 16.04', but is building on a 'Ubuntu 19.04' host.
Read more about bases at https://docs.snapcraft.io/t/base-snaps/11198
Hit http://in.archive.ubuntu.com/ubuntu disco InRelease
Hit http://in.archive.ubuntu.com/ubuntu disco-updates InRelease
Hit http://in.archive.ubuntu.com/ubuntu disco-backports InRelease
Hit http://security.ubuntu.com/ubuntu disco-security InRelease
Fetched 0 B in 0s (0 B/s)
Pulling test-app
Cloning into '/home/matrix11/DeployWorkstation/test-app/parts/test-app/src'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), done.
Fetching and installing pip...
Collecting pip
Using cached https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl
Saved ./parts/test-app/python-packages/pip-20.0.2-py2.py3-none-any.whl
Successfully downloaded pip
Looking in links: /home/matrix11/DeployWorkstation/test-app/parts/test-app/python-packages
Collecting pip
Installing collected packages: pip
Successfully installed pip-20.0.2
Traceback (most recent call last):
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/__main__.py", line 16, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py", line 19, in <module>
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils.util'
Traceback (most recent call last):
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/__main__.py", line 16, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py", line 19, in <module>
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils.util'
Sorry, an error occurred in Snapcraft:
Failed to run '/home/matrix11/DeployWorkstation/test-app/parts/test-app/install/usr/bin/python3 -m pip list': Exited with code 1.
currently i’m running ubuntu 19.04 with both python2.7 and python3.7.
the module distutils is installed in both of the python version.
files in my directory (test-app/):
snap/snapcraft.yaml
name: test-app # you probably want to 'snapcraft register <name>'
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: test-app snap # 79 char long summary
description: |
long test-app snap
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
apps:
test-app:
command: bin/test-app
parts:
test-app:
# See 'snapcraft plugins'
plugin: python
source: https://github.com/purvesh-linux11/test-app.git
setup.py
from setuptools import setup
setup(
name='test-app',
version='0.1',
url='<my github url>',
author='purvesh',
author_email='<my-email>',
description='this is sample test app for snap.'
)
test-app.py (my custom file)
def main():
args = sys.argv[1]
print("snapcraft is working. . . . . . . . . . . . .let's start the FUNNNN..!!!",'\n')
print("greeting my friend, ",args)
if __name__ == '__main__':
main()
help me out guys…please.
Thanks for Understanding my problem.