Openstackをシングルノードで構築しています。Horizonパッケージインストール時以下のエラーが発生します。  
KeyError: 'collectstatic' が発生していることが第一の原因かと思いますが、このエラーが発生する理由もわかりません。  
原因、対処方法などをご存じの方がいらっしゃいましたらご教示願います。

以下は `apt-get install` の実行結果です。

```

    root@dlp:~# sudo apt-get install -y openstack-dashboard
    eading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
    libboost-iostreams1.71.0 libboost-thread1.71.0
    Use 'sudo apt autoremove' to remove them.
    The following NEW packages will be installed:
    openstack-dashboard
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/18.8 kB of archives.
    After this operation, 33.8 kB of additional disk space will be used.
    Selecting previously unselected package openstack-dashboard.
    (Reading database ... 228476 files and directories currently installed.)
    Preparing to unpack .../openstack-dashboard_4%3a19.2.0-0ubuntu1~cloud0_all.deb ...
    Unpacking openstack-dashboard (4:19.2.0-0ubuntu1~cloud0) ...
    Setting up openstack-dashboard (4:19.2.0-0ubuntu1~cloud0) ...
    Collecting and compressing static assets...
    /usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
    from cryptography.utils import int_from_bytes
    /usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
    from cryptography.utils import int_from_bytes
    WARNING:root:"dashboards" and "default_dashboard" in (local_)settings is DEPRECATED now and may be unsupported in some future release. The preferred way to specify the order of dashboards and the default dashboard is the pluggable dashboard mechanism (in /usr/share/openstack-dashboard/openstack_dashboard/enabled, /usr/share/openstack-dashboard/openstack_dashboard/local/enabled).
    /usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
    Traceback (most recent call last):
    File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 204, in fetch_command
    app_name = commands[subcommand]
    KeyError: 'collectstatic'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
    File "manage.py", line 25, in <module>
    execute_from_command_line(sys.argv)
    File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 381, in execute_from_command_line
    utility.execute()
    File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 211, in fetch_command
    settings.INSTALLED_APPS
    File "/usr/local/lib/python3.8/dist-packages/django/conf/init.py", line 79, in getattr
    self._setup(name)
    File "/usr/local/lib/python3.8/dist-packages/django/conf/init.py", line 66, in _setup
    self._wrapped = Settings(settings_module)
    File "/usr/local/lib/python3.8/dist-packages/django/conf/init.py", line 157, in init
    mod = importlib.import_module(self.SETTINGS_MODULE)
    File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 848, in exec_module
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    File "/usr/share/openstack-dashboard/openstack_dashboard/settings.py", line 352, in <module>
    STATICFILES_DIRS += settings_utils.get_xstatic_dirs(
    File "/usr/share/openstack-dashboard/openstack_dashboard/utils/settings.py", line 288, in get_xstatic_dirs
    module = import_module(module_name)
    File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
    ModuleNotFoundError: No module named 'horizon.xstatic'
    dpkg: error processing package openstack-dashboard (--configure):
    installed openstack-dashboard package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
    openstack-dashboard
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
```

(追記1)pip install実施のエラー

```

    root@dlp:~# sudo pip install -c https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/stein -r https://raw.githubusercontent.com/openstack/horizon/stable/stein/requirements.txt
    (中略)
    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    keystone 19.1.0.dev15 requires dogpile.cache>=1.0.2, but you have dogpile-cache 0.7.1 which is incompatible.
    keystone 19.1.0.dev15 requires jsonschema>=3.2.0, but you have jsonschema 2.6.0 which is incompatible.
    keystone 19.1.0.dev15 requires oslo.log>=3.44.0, but you have oslo-log 3.42.5 which is incompatible.
    keystone 19.1.0.dev15 requires oslo.policy>=3.6.0, but you have oslo-policy 2.1.3 which is incompatible.
    keystone 19.1.0.dev15 requires oslo.upgradecheck>=1.3.0, but you have oslo-upgradecheck 0.2.1 which is incompatible.
    glance 23.0.0.0b3.dev25 requires jsonschema>=3.2.0, but you have jsonschema 2.6.0 which is incompatible.
    glance 23.0.0.0b3.dev25 requires oslo.config>=8.1.0, but you have oslo-config 6.8.2 which is incompatible.
    glance 23.0.0.0b3.dev25 requires oslo.i18n>=5.0.0, but you have oslo-i18n 3.23.1 which is incompatible.
    glance 23.0.0.0b3.dev25 requires oslo.log>=4.3.0, but you have oslo-log 3.42.5 which is incompatible.
    glance 23.0.0.0b3.dev25 requires oslo.policy>=3.7.0, but you have oslo-policy 2.1.3 which is incompatible.
    glance 23.0.0.0b3.dev25 requires oslo.upgradecheck>=1.3.0, but you have oslo-upgradecheck 0.2.1 which is incompatible.
    glance 23.0.0.0b3.dev25 requires oslo.utils>=4.7.0, but you have oslo-utils 3.40.7 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires cryptography>=3.1, but you have cryptography 2.8 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires decorator>=4.4.2, but you have decorator 4.3.2 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires jsonschema>=3.2.0, but you have jsonschema 2.6.0 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires keystoneauth1>=4.2.1, but you have keystoneauth1 3.13.2 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires oslo.concurrency>=4.4.0, but you have oslo-concurrency 3.29.1 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires oslo.config>=8.3.2, but you have oslo-config 6.8.2 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires oslo.context>=3.1.1, but you have oslo-context 2.22.2 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires oslo.i18n>=5.0.1, but you have oslo-i18n 3.23.1 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires oslo.log>=4.4.0, but you have oslo-log 3.42.5 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires oslo.policy>=3.6.2, but you have oslo-policy 2.1.3 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires oslo.serialization>=4.1.0, but you have oslo-serialization 2.28.2 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires oslo.upgradecheck>=1.1.1, but you have oslo-upgradecheck 0.2.1 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires oslo.utils>=4.8.0, but you have oslo-utils 3.40.7 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires osprofiler>=3.4.0, but you have osprofiler 2.6.1 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires pbr>=5.5.1, but you have pbr 5.1.3 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires pyparsing>=2.4.7, but you have pyparsing 2.3.1 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires python-glanceclient>=3.2.2, but you have python-glanceclient 2.16.0 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires python-keystoneclient>=4.1.1, but you have python-keystoneclient 3.19.1 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires python-novaclient>=17.2.1, but you have python-novaclient 13.0.2 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires python-swiftclient>=3.10.1, but you have python-swiftclient 3.7.1 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires pytz>=2020.1, but you have pytz 2018.9 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires requests>=2.25.1, but you have requests 2.21.0 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires six>=1.15.0, but you have six 1.12.0 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires stevedore>=3.2.2, but you have stevedore 1.30.1 which is incompatible.
    cinder 19.0.0.0b2.dev2 requires WebOb>=1.8.6, but you have webob 1.8.5 which is incompatible.
    neutron 18.1.0.dev508 requires keystoneauth1>=3.14.0, but you have keystoneauth1 3.13.2 which is incompatible.
    neutron 18.1.0.dev508 requires openstacksdk>=0.31.2, but you have openstacksdk 0.27.1 which is incompatible.
    neutron 18.1.0.dev508 requires oslo.config>=8.0.0, but you have oslo-config 6.8.2 which is incompatible.
    neutron 18.1.0.dev508 requires oslo.log>=4.3.0, but you have oslo-log 3.42.5 which is incompatible.
    neutron 18.1.0.dev508 requires oslo.policy>=3.7.0, but you have oslo-policy 2.1.3 which is incompatible.
    neutron 18.1.0.dev508 requires oslo.upgradecheck>=1.3.0, but you have oslo-upgradecheck 0.2.1 which is incompatible.
    neutron 18.1.0.dev508 requires oslo.utils>=4.5.0, but you have oslo-utils 3.40.7 which is incompatible.
    nova 23.1.0.dev289 requires jsonschema>=3.2.0, but you have jsonschema 2.6.0 which is incompatible.
    nova 23.1.0.dev289 requires keystoneauth1>=3.16.0, but you have keystoneauth1 3.13.2 which is incompatible.
    nova 23.1.0.dev289 requires openstacksdk>=0.35.0, but you have openstacksdk 0.27.1 which is incompatible.
    nova 23.1.0.dev289 requires os-service-types>=1.7.0, but you have os-service-types 1.6.0 which is incompatible.
    nova 23.1.0.dev289 requires oslo.concurrency>=4.4.0, but you have oslo-concurrency 3.29.1 which is incompatible.
    nova 23.1.0.dev289 requires oslo.config>=8.6.0, but you have oslo-config 6.8.2 which is incompatible.
    nova 23.1.0.dev289 requires oslo.context>=3.1.1, but you have oslo-context 2.22.2 which is incompatible.
    nova 23.1.0.dev289 requires oslo.i18n>=5.0.1, but you have oslo-i18n 3.23.1 which is incompatible.
    nova 23.1.0.dev289 requires oslo.log>=4.4.0, but you have oslo-log 3.42.5 which is incompatible.
    nova 23.1.0.dev289 requires oslo.policy>=3.7.0, but you have oslo-policy 2.1.3 which is incompatible.
    nova 23.1.0.dev289 requires oslo.serialization>=4.1.0, but you have oslo-serialization 2.28.2 which is incompatible.
    nova 23.1.0.dev289 requires oslo.upgradecheck>=1.3.0, but you have oslo-upgradecheck 0.2.1 which is incompatible.
    nova 23.1.0.dev289 requires oslo.utils>=4.8.0, but you have oslo-utils 3.40.7 which is incompatible.
    nova 23.1.0.dev289 requires pbr>=5.5.1, but you have pbr 5.1.3 which is incompatible.
    nova 23.1.0.dev289 requires python-neutronclient>=7.1.0, but you have python-neutronclient 6.12.1 which is incompatible.
    nova 23.1.0.dev289 requires PyYAML>=5.1, but you have pyyaml 3.13 which is incompatible.
    nova 23.1.0.dev289 requires requests>=2.25.1, but you have requests 2.21.0 which is incompatible.
    openstack-placement 5.1.0.dev27 requires jsonschema>=3.2.0, but you have jsonschema 2.6.0 which is incompatible.
    openstack-placement 5.1.0.dev27 requires oslo.log>=4.3.0, but you have oslo-log 3.42.5 which is incompatible.
    openstack-placement 5.1.0.dev27 requires oslo.policy>=3.7.0, but you have oslo-policy 2.1.3 which is incompatible.
    openstack-placement 5.1.0.dev27 requires oslo.upgradecheck>=1.3.0, but you have oslo-upgradecheck 0.2.1 which is incompatible.
    openstack-placement 5.1.0.dev27 requires oslo.utils>=4.5.0, but you have oslo-utils 3.40.7 which is incompatible.
    openstack-placement 5.1.0.dev27 requires requests>=2.25.0, but you have requests 2.21.0 which is incompatible.
    horizon 20.0.1.dev6 requires Django<3.0,>=2.2, but you have django 2.0.13 which is incompatible.
    horizon 20.0.1.dev6 requires keystoneauth1>=4.3.1, but you have keystoneauth1 3.13.2 which is incompatible.
    horizon 20.0.1.dev6 requires oslo.i18n>=5.0.1, but you have oslo-i18n 3.23.1 which is incompatible.
    horizon 20.0.1.dev6 requires oslo.policy>=3.2.0, but you have oslo-policy 2.1.3 which is incompatible.
    horizon 20.0.1.dev6 requires oslo.utils>=4.8.0, but you have oslo-utils 3.40.7 which is incompatible.
    horizon 20.0.1.dev6 requires pbr>=5.5.0, but you have pbr 5.1.3 which is incompatible.
    horizon 20.0.1.dev6 requires python-cinderclient>=8.0.0, but you have python-cinderclient 4.2.2 which is incompatible.
    horizon 20.0.1.dev6 requires python-keystoneclient>=3.22.0, but you have python-keystoneclient 3.19.1 which is incompatible.
    horizon 20.0.1.dev6 requires requests>=2.25.1, but you have requests 2.21.0 which is incompatible.
    tempest 28.0.1.dev11 requires jsonschema>=3.2.0, but you have jsonschema 2.6.0 which is incompatible.
    tempest 28.0.1.dev11 requires oslo.utils>=4.7.0, but you have oslo-utils 3.40.7 which is incompatible.
    tox 3.24.0 requires six>=1.14.0, but you have six 1.12.0 which is incompatible.
    tooz 2.9.0 requires oslo.utils>=4.7.0, but you have oslo-utils 3.40.7 which is incompatible.
    taskflow 4.6.1 requires jsonschema>=3.2.0, but you have jsonschema 2.6.0 which is incompatible.
    python-openstackclient 5.5.0 requires cliff>=3.5.0, but you have cliff 2.14.1 which is incompatible.
    python-openstackclient 5.5.0 requires openstacksdk>=0.53.0, but you have openstacksdk 0.27.1 which is incompatible.
    python-openstackclient 5.5.0 requires osc-lib>=2.3.0, but you have osc-lib 1.12.1 which is incompatible.
    python-openstackclient 5.5.0 requires python-keystoneclient>=3.22.0, but you have python-keystoneclient 3.19.1 which is incompatible.
    python-openstackclient 5.5.0 requires python-novaclient>=17.0.0, but you have python-novaclient 13.0.2 which is incompatible.
    python-openstackclient 5.5.0 requires stevedore>=2.0.1, but you have stevedore 1.30.1 which is incompatible.
    pypowervm 1.1.26 requires pytz>=2019.3, but you have pytz 2018.9 which is incompatible.
    pypowervm 1.1.26 requires six>=1.14.0, but you have six 1.12.0 which is incompatible.
    oslo-versionedobjects 2.4.0 requires oslo.utils>=4.7.0, but you have oslo-utils 3.40.7 which is incompatible.
    oslo-privsep 2.6.0 requires cffi>=1.14.0, but you have cffi 1.12.2 which is incompatible.
    oslo-limit 1.4.0 requires openstacksdk>=0.31.1, but you have openstacksdk 0.27.1 which is incompatible.
    oslo-limit 1.4.0 requires oslo.log>=3.44.0, but you have oslo-log 3.42.5 which is incompatible.
    oslo-cache 2.8.1 requires dogpile.cache>=1.1.2, but you have dogpile-cache 0.7.1 which is incompatible.
    oslo-cache 2.8.1 requires oslo.config>=8.1.0, but you have oslo-config 6.8.2 which is incompatible.
    oslo-cache 2.8.1 requires oslo.i18n>=5.0.0, but you have oslo-i18n 3.23.1 which is incompatible.
    oslo-cache 2.8.1 requires oslo.log>=4.2.1, but you have oslo-log 3.42.5 which is incompatible.
    oslo-cache 2.8.1 requires oslo.utils>=4.2.0, but you have oslo-utils 3.40.7 which is incompatible.
    os-win 5.4.0 requires oslo.utils>=4.7.0, but you have oslo-utils 3.40.7 which is incompatible.
    os-brick 4.4.0 requires oslo.concurrency>=4.4.0, but you have oslo-concurrency 3.29.1 which is incompatible.
    os-brick 4.4.0 requires oslo.context>=3.1.1, but you have oslo-context 2.22.2 which is incompatible.
    os-brick 4.4.0 requires oslo.i18n>=5.0.1, but you have oslo-i18n 3.23.1 which is incompatible.
    os-brick 4.4.0 requires oslo.log>=4.4.0, but you have oslo-log 3.42.5 which is incompatible.
    os-brick 4.4.0 requires oslo.serialization>=4.1.0, but you have oslo-serialization 2.28.2 which is incompatible.
    os-brick 4.4.0 requires oslo.utils>=4.8.0, but you have oslo-utils 3.40.7 which is incompatible.
    os-brick 4.4.0 requires pbr>=5.5.1, but you have pbr 5.1.3 which is incompatible.
    os-brick 4.4.0 requires requests>=2.25.1, but you have requests 2.21.0 which is incompatible.
    neutron-lib 2.12.0 requires keystoneauth1>=3.14.0, but you have keystoneauth1 3.13.2 which is incompatible.
    neutron-lib 2.12.0 requires oslo.config>=8.0.0, but you have oslo-config 6.8.2 which is incompatible.
    neutron-lib 2.12.0 requires oslo.log>=4.3.0, but you have oslo-log 3.42.5 which is incompatible.
    neutron-lib 2.12.0 requires oslo.policy>=3.6.2, but you have oslo-policy 2.1.3 which is incompatible.
    neutron-lib 2.12.0 requires oslo.utils>=4.5.0, but you have oslo-utils 3.40.7 which is incompatible.
    keystonemiddleware 9.3.0 requires python-keystoneclient>=3.20.0, but you have python-keystoneclient 3.19.1 which is incompatible.
    httplib2 0.19.1 requires pyparsing<3,>=2.4.2, but you have pyparsing 2.3.1 which is incompatible.
    google-api-python-client 2.14.0 requires six<2dev,>=1.13.0, but you have six 1.12.0 which is incompatible.
    google-api-core 1.31.0 requires six>=1.13.0, but you have six 1.12.0 which is incompatible.
    glance-store 2.6.0 requires jsonschema>=3.2.0, but you have jsonschema 2.6.0 which is incompatible.
    glance-store 2.6.0 requires oslo.utils>=4.7.0, but you have oslo-utils 3.40.7 which is incompatible.
    enmerkar 0.7.1 requires django>=2.2, but you have django 2.0.13 which is incompatible.
    botocore 1.21.6 requires urllib3<1.27,>=1.25.4, but you have urllib3 1.24.1 which is incompatibl
    Successfully installed Babel-2.6.0 Django-2.0.13 Pint-0.9 PyYAML-3.13 WebOb-1.8.5 XStatic-Angular-Bootstrap-2.
    (後略)
    
```
CC BY-SA 4.0
2021-09-02T05:54:02.237
82177
2021-09-03T05:09:05.437
2021-09-03T05:09:05.437
48016
48016
question
python django apt
apt-get install 実行時に発生する、KeyError: 'collectstatic'のエラーの解消方法