A recent version of pip (21.0) was released which drops support for Python 3.5 and Python 2
- Drop support for Python 3.5 https://github.com/pypa/pip/issues/9189
- Drop support for Python 2 https://github.com/pypa/pip/issues/6148
Building a snap without base specified will result in building the snap using the core base which is based on Ubuntu 16.04 which ships with python3.5 and the snap build upgrades pip to a version no longer support thus breaking any pip installs and snap build
10:56:47 Fetching and installing pip...
10:56:48 Collecting pip
10:56:48 Downloading https://files.pythonhosted.org/packages/9e/24/bc928987f35dd0167f21b13a1777c21b9c5917c9894cff93f1c1a6cb8f3b/pip-21.0.tar.gz (1.5MB)
10:56:49 Saved ./parts/SNIP/python-packages/pip-21.0.tar.gz
10:56:49 Successfully downloaded pip
10:56:50 Ignoring indexes: https://pypi.python.org/simple
10:56:50 Collecting pip
10:56:50 Building wheels for collected packages: pip
10:56:50 Running setup.py bdist_wheel for pip: started
10:56:51 Running setup.py bdist_wheel for pip: finished with status 'done'
10:56:51 Stored in directory: /root/.cache/pip/wheels/d8/1b/94/77efa18b1280b4d8696adf952ec14b2047ae73d49d46e494d6
10:56:51 Successfully built pip
10:56:51 Installing collected packages: pip
10:56:51 Successfully installed pip-8.1.1
10:56:52 Traceback (most recent call last):
10:56:52 File "/root/snap-source/snap-source/parts/SNIP/install/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
10:56:52 "__main__", fname, loader, pkg_name)
10:56:52 File "/root/snap-source/snap-source/parts/SNIP/install/usr/lib/python2.7/runpy.py", line 72, in _run_code
10:56:52 exec code in run_globals
10:56:52 File "/root/snap-source/snap-source/parts/SNIP/install/lib/python2.7/site-packages/pip/__main__.py", line 21, in <module>
10:56:52 from pip._internal.cli.main import main as _main
10:56:52 File "/root/snap-source/snap-source/parts/SNIP/install/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60
10:56:52 sys.stderr.write(f"ERROR: {exc}")
10:56:52 ^
10:56:52 SyntaxError: invalid syntax
10:56:52 Traceback (most recent call last):
10:56:52 File "/root/snap-source/snap-source/parts/SNIP/install/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
10:56:52 "__main__", fname, loader, pkg_name)
10:56:52 File "/root/snap-source/snap-source/parts/SNIP/install/usr/lib/python2.7/runpy.py", line 72, in _run_code
10:56:52 exec code in run_globals
10:56:52 File "/root/snap-source/snap-source/parts/SNIP/install/lib/python2.7/site-packages/pip/__main__.py", line 21, in <module>
10:56:52 from pip._internal.cli.main import main as _main
10:56:52 File "/root/snap-source/snap-source/parts/SNIP/install/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60
10:56:52 sys.stderr.write(f"ERROR: {exc}")
10:56:52 ^
10:56:52 SyntaxError: invalid syntax
10:56:52 Sorry, an error occurred in Snapcraft:
The solution is to pin pip to <21.