It seems that the layer-basic pulls in pyYAML which then collides with some system package. I'm not sure about the mechanism, but perhaps there is a way to get around this issue since I'm only including layer-basic in my charm (layer.yaml).
$ juju debug-log 2020-10-19 17:12:42 DEBUG install Found existing installation: six 1.15.0
2020-10-19 17:12:42 DEBUG install Uninstalling six-1.15.0:
2020-10-19 17:12:42 DEBUG install Successfully uninstalled six-1.15.0
2020-10-19 17:12:42 DEBUG install Running setup.py install for six: started
2020-10-19 17:12:42 DEBUG install Running setup.py install for six: finished with status 'done'
2020-10-19 17:12:42 DEBUG install Found existing installation: netaddr 0.7.19
2020-10-19 17:12:42 DEBUG install Uninstalling netaddr-0.7.19:
2020-10-19 17:12:42 DEBUG install Successfully uninstalled netaddr-0.7.19
2020-10-19 17:12:42 DEBUG install Running setup.py install for netaddr: started
2020-10-19 17:12:43 DEBUG install Running setup.py install for netaddr: finished with status 'done'
2020-10-19 17:12:43 DEBUG install Found existing installation: PyYAML 3.12
2020-10-19 17:12:43 DEBUG install Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
2020-10-19 17:12:43 DEBUG install Traceback (most recent call last):
2020-10-19 17:12:43 DEBUG install File "/var/lib/juju/agents/unit-nextcloud-2/charm/hooks/install", line 8, in <module>
2020-10-19 17:12:43 DEBUG install basic.bootstrap_charm_deps()
2020-10-19 17:12:43 DEBUG install File "lib/charms/layer/basic.py", line 208, in bootstrap_charm_deps
2020-10-19 17:12:43 DEBUG install env=_get_subprocess_env())
2020-10-19 17:12:43 DEBUG install File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
2020-10-19 17:12:43 DEBUG install raise CalledProcessError(retcode, cmd)
2020-10-19 17:12:43 DEBUG install subprocess.CalledProcessError: Command '['pip3', 'install', '-U', '--force-reinstall', '--no-index', '--no-cache-dir', '-f', 'wheelhouse', 'wheel', 'pbr', 'Jinja2', 'six', 'netaddr', 'PyYAML', 'MarkupSafe', 'pyaml', 'Tempita', 'charmhelpers', 'charms.reactive']' returned non-zero exit status 1.
I'm trying to deploy a charm I've built some time ago which now fails to deploy: https://github.com/erik78se/layer-nextcloud
It seems that the layer-basic pulls in pyYAML which then collides with some system package. I'm not sure about the mechanism, but perhaps there is a way to get around this issue since I'm only including layer-basic in my charm (layer.yaml).