Need help: "cannot import name 'async_clear_install_history'" after update to 2021.11.3

Hi, I run HA on a Raspberry Pi 4 with DietPi v7.8.2 and just updated from 2021.8.8 to 2021.11.3 with the dietpi update script without any issues visible during the update process.

After the successful update, I tried to restart HA server, but it warned me:

Logger: homeassistant.components.websocket_api.http.connection
Source: helpers/
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 20:43:52 (2 occurrences)
Last logged: 20:55:11

[547355522000] cannot import name 'async_clear_install_history' from 'homeassistant.requirements' (/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/
Traceback (most recent call last):
  File "/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/components/websocket_api/", line 185, in handle_call_service
  File "/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/", line 1491, in async_call
    _LOGGER.debug("Service was cancelled: %s", service_call)
  File "/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/", line 1526, in _execute_service
    self, handler: Service, service_call: ServiceCall
  File "/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/helpers/", line 728, in admin_handler
    if call.context.user_id:
  File "/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/components/homeassistant/", line 148, in async_handle_core_service
  File "/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/", line 921, in async_check_ha_config_file
  File "/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/helpers/", line 27, in <module>
    from homeassistant.requirements import (
ImportError: cannot import name 'async_clear_install_history' from 'homeassistant.requirements' (/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/

So now the system is running the old version and I am afraid it might not start up again after updating DietPi and restarting the HA service due to the error, and also I would be stuck with version 2021.8.8 :frowning:

If I check “/home/homeassistant/.pyenv/versions/3.8.10/lib/python3.8/site-packages/homeassistant/” I find

def async_clear_install_history(hass: HomeAssistant) -> None:
    """Forget the install history."""
    if install_failure_history :=

so why can’t the function not be imported and I do anything to fix this or work around it? I tried to google the error message, but I did not find anything that helps me.

I did the update because I tried to install HACS before, but when I wanted to activate the integration it told me my HA version was outdated. So then I did the update and I guess the error might also be caused by the HACS installation. What I did to install HACS was to run

[email protected]:/mnt/dietpi_userdata/homeassistant# wget -O - | bash -

So now I tried moving the hacs files somewhere else, hoping this might avoid the installation of HACS and not cause the error, but I got the same error when trying to restart HA. It was probably a stupid thought anyway, because the installation was done when I ran the script.

Sorry if this a dumb question, sorry for my english and thanks for any helpful advice pointing me in the right direction… I would also appreciate notes from advanced users that no one will bother to help me because the problem is so obvious (like when I missed some instruction) or so specific and unique that it is not worth looking into and rather restore the backup. I do have an up to date backup I can restore, but I would rather figure out what is wrong and how to fix it, also because I would guess that I run into the same issue after trying to update from my backup of 2021.8.8.

Here are some more info about my system (Raspberry Pi 4 with DietPi v7.8.2):

Version	core-2021.8.8
Installationstyp	Unknown
Entwicklung	false
Supervisor	false
Docker	false
user	homeassistant
Virtuelle Umgebung	false
Python-Version	3.8.10
Betriebssystemfamilie	Linux
Betriebssystem-Version	5.10.63-v8+
CPU-Architektur	aarch64
Zeitzone	Europe/Berlin

Thanks and cheers