Integration: No module named 'aiofiles'

Created on 16 Jun 2019  路  8Comments  路  Source: hacs/integration

Version of HACS


7.0

Describe the bug

Adding hacs to configuration.yaml file breaks hassio when restarting. The validation failed with "Component not found: hacs" before restarting.

The error log tells me that I'm missing aiofiles. I can't figure out how to add that, do you have any suggestions? The error is duplicated in the log for each component setup.

Debug log

2019-06-15 22:31:01 ERROR (MainThread) [homeassistant.setup] Error during setup of component frontend
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "uvloop/loop.pyx", line 1451, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.7/site-packages/homeassistant/__main__.py", line 290, in setup_and_run_hass
    log_no_color=args.log_no_color)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/bootstrap.py", line 181, in async_from_config_file
    config_dict, hass, enable_log=False, skip_pip=skip_pip)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/bootstrap.py", line 92, in async_from_config_dict
    await _async_set_up_integrations(hass, config)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/bootstrap.py", line 404, in _async_set_up_integrations
    for domain in domains_to_load
  File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 50, in async_setup_component
    return await task  # type: ignore
  File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 126, in _async_setup_component
    hass, config, integration)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/config.py", line 773, in async_process_component_config
    component = integration.get_component()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 130, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/hacs/__init__.py", line 36, in <module>
    from .frontend.views import (
  File "/config/custom_components/hacs/frontend/views/__init__.py", line 2, in <module>
    from .error import HacsErrorView
  File "/config/custom_components/hacs/frontend/views/error.py", line 10, in <module>
    from ...blueprints import HacsViewBase
  File "/config/custom_components/hacs/blueprints.py", line 3, in <module>
    from .hacsrepositorybase import HacsRepositoryBase
  File "/config/custom_components/hacs/hacsrepositorybase.py", line 13, in <module>
    from .handler.download import async_download_file, async_save_file
  File "/config/custom_components/hacs/handler/download.py", line 4, in <module>
    import aiofiles
ModuleNotFoundError: No module named 'aiofiles'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 153, in _async_setup_component
    hass, processed_config)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/frontend/__init__.py", line 246, in async_setup
    'kiosk', 'states', 'profile')], loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 363, in wait
    return await _wait(fs, timeout, return_when, loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 456, in _wait
    await waiter
concurrent.futures._base.CancelledError

Most helpful comment

I'm facing this issue, but numerous restarts don't seem to help :/
Any other suggestions would be greatly appreciated.

All 8 comments

After upgrading in the component, I鈥檓 getting a partial config failure when I run hassio ha check. aiofiles and backoff fail. Can鈥檛 copy log because I鈥檓 on mobile right now.

Actually, I got a partial copy.

ERROR: Could not find a version that satisfies the requirement aiofiles (from versions: none) ERROR: No matching distribution found for aiofiles ERROR:homeassistant.requirements:Not initializing hacs because could not install requirement aiofiles Failed config General Errors: - Unable to install all requirements: aiofiles, backoff

Full log:

Error: Testing configuration at /config INFO:homeassistant.util.package:Attempting install of aiofiles ERROR:homeassistant.util.package:Unable to install package aiofiles: WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb89835c0>: Failed to establish a new connection: [Errno -3] Try again')': /simple/aiofiles/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb8983668>: Failed to establish a new connection: [Errno -3] Try again')': /simple/aiofiles/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb8983320>: Failed to establish a new connection: [Errno -3] Try again')': /simple/aiofiles/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb8983400>: Failed to establish a new connection: [Errno -3] Try again')': /simple/aiofiles/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb89833c8>: Failed to establish a new connection: [Errno -3] Try again')': /simple/aiofiles/ WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb89fbdd8>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.9/aarch64/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb89fbda0>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.9/aarch64/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb89fbb00>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.9/aarch64/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb89fbb70>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.9/aarch64/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb89fbb38>: Failed to establish a new connection: [Errno -3] Try again')': /alpine-3.9/aarch64/ ERROR: Could not find a version that satisfies the requirement aiofiles (from versions: none) ERROR: No matching distribution found for aiofiles ERROR:homeassistant.requirements:Not initializing hacs because could not install requirement aiofiles WARNING:homeassistant.components.http:Configuring trusted_networks via the http component has been deprecated. Use the trusted networks auth provider instead. For instructions, see https://www.home-assistant.io/docs/authentication/providers/#trusted-networks Failed config General Errors: - Unable to install all requirements: aiofiles, backoff Successful config (partial)

Home Assistant tries to install the dependencies on startup.
Sometimes that fails, a second restart should get you up and running.

It works!

Haven't touched the configuration since I created the issue, but now I added hacs back in, it passed validation and after a restart it appeared in HA. Easy as that. Thank you.

I'm facing this issue, but numerous restarts don't seem to help :/
Any other suggestions would be greatly appreciated.

Component error: hacs - Requirements for hacs not found: ['aiofiles==0.4.0']

This happens when you run in a docker container and specified --user. Looks like dependencies can be installed only when homeassistant is running as root.

This issue is closed, closed issues are ignored.

If you have issues similar to this, please open a seperate issue.
https://github.com/custom-components/hacs/issues/new/choose

And remember to fill out the entire issue template :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tamas-Toth-ebola picture Tamas-Toth-ebola  路  6Comments

emics picture emics  路  8Comments

JPM-git picture JPM-git  路  8Comments

lbouriez picture lbouriez  路  6Comments

noxhirsch picture noxhirsch  路  6Comments