Can't update Hass.io ERROR: Failed building wheel for multidict

My google-fu has failed me.

Any ideas why this is failing?

From the Check Home Assistant configuration Plugin:

warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files found matching 'multidict/_multidict.html'
  warning: no previously-included files found matching 'multidict/*.so'
  warning: no previously-included files found matching 'multidict/*.pyd'
  warning: no previously-included files found matching 'multidict/*.pyd'
  no previously-included directories found matching 'docs/_build'
  writing manifest file 'multidict.egg-info/SOURCES.txt'
  copying multidict/__init__.pyi -> build/lib.linux-armv7l-3.7/multidict
  copying multidict/_multidict.c -> build/lib.linux-armv7l-3.7/multidict
  copying multidict/py.typed -> build/lib.linux-armv7l-3.7/multidict
  creating build/lib.linux-armv7l-3.7/multidict/_multilib
  copying multidict/_multilib/defs.h -> build/lib.linux-armv7l-3.7/multidict/_multilib
  copying multidict/_multilib/dict.h -> build/lib.linux-armv7l-3.7/multidict/_multilib
  copying multidict/_multilib/istr.h -> build/lib.linux-armv7l-3.7/multidict/_multilib
  copying multidict/_multilib/iter.h -> build/lib.linux-armv7l-3.7/multidict/_multilib
  copying multidict/_multilib/pair_list.h -> build/lib.linux-armv7l-3.7/multidict/_multilib
  copying multidict/_multilib/views.h -> build/lib.linux-armv7l-3.7/multidict/_multilib
  running build_ext
  building 'multidict._multidict' extension
  creating build/temp.linux-armv7l-3.7
  creating build/temp.linux-armv7l-3.7/multidict
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.7m -c multidict/_multidict.c -o build/temp.linux-armv7l-3.7/multidict/_multidict.o -O2 -std=c99 -Wall -Wsign-compare -Wconversion -fno-strict-aliasing -pedantic
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for multidict
ERROR: Could not build wheels for multidict which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 19.2.2, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[11:23:46] ERROR: An error occurred while installing Home Assistant:
Looking in links: https://wheels.home-assistant.io/alpine-3.10/armv7/
Collecting homeassistant
  Downloading https://files.pythonhosted.org/packages/87/c9/f41fcf931501f07ef9ca12365fd09eb879f6755618f375b058a229d9c94b/homeassistant-0.103.6-py3-none-any.whl (6.0MB)
Collecting async-timeout==3.0.1 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/e1/1e/5a4441be21b0726c4464f3f23c8b19628372f606755a9d2e46c187e65ec4/async_timeout-3.0.1-py3-none-any.whl
Collecting bcrypt==3.1.7 (from homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/bcrypt-3.1.7-cp37-none-any.whl (57kB)
Collecting pytz>=2019.03 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl (509kB)
Collecting voluptuous==0.11.7 (from homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/voluptuous-0.11.7-py3-none-any.whl
Collecting cryptography==2.8 (from homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/cryptography-2.8-cp37-none-any.whl (877kB)
Collecting importlib-metadata==0.23 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/f6/d2/40b3fa882147719744e6aa50ac39cf7a22a913cbcba86a0371176c425a3b/importlib_metadata-0.23-py2.py3-none-any.whl
Collecting python-slugify==4.0.0 (from homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/python_slugify-4.0.0-py2.py3-none-any.whl
Collecting ruamel.yaml==0.15.100 (from homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/ruamel.yaml-0.15.100-cp37-none-any.whl (656kB)
Collecting jinja2>=2.10.3 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/65/e0/eb35e762802015cab1ccee04e8a277b03f1d8e53da3ec3106882ec42558b/Jinja2-2.10.3-py2.py3-none-any.whl (125kB)
Collecting astral==1.10.1 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/ff/5d/261f49822b7f77c265197d46cdbaaaaf06f458734e9ac55a140dd75bdf29/astral-1.10.1-py2.py3-none-any.whl
Collecting aiohttp==3.6.1 (from homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/aiohttp-3.6.1-cp37-none-any.whl (1.2MB)
Collecting PyJWT==1.7.1 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/87/8b/6a9f14b5f781697e51259d81657e6048fd31a113229cf346880bb7545565/PyJWT-1.7.1-py2.py3-none-any.whl
Requirement already satisfied: pip>=8.0.3 in /usr/local/lib/python3.7/site-packages (from homeassistant) (19.2.2)
Collecting pyyaml==5.1.2 (from homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/PyYAML-5.1.2-cp37-none-any.whl (44kB)
Collecting voluptuous-serialize==2.3.0 (from homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/voluptuous_serialize-2.3.0-py3-none-any.whl
Collecting requests==2.22.0 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
Collecting attrs==19.3.0 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting certifi>=2019.9.11 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl (156kB)
Collecting six>=1.4.1 (from bcrypt==3.1.7->homeassistant)
  Downloading https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Requirement already satisfied: cffi>=1.1 in /usr/local/lib/python3.7/site-packages (from bcrypt==3.1.7->homeassistant) (1.12.3)
Collecting zipp>=0.5 (from importlib-metadata==0.23->homeassistant)
  Downloading https://files.pythonhosted.org/packages/74/3d/1ee25a26411ba0401b43c6376d2316a71addcc72ef8690b101b4ea56d76a/zipp-0.6.0-py2.py3-none-any.whl
Collecting text-unidecode>=1.3 (from python-slugify==4.0.0->homeassistant)
  Downloading https://files.pythonhosted.org/packages/a6/a5/c0b6468d3824fe3fde30dbb5e1f687b291608f9473681bbf7dabbf5a87d7/text_unidecode-1.3-py2.py3-none-any.whl (78kB)
Collecting MarkupSafe>=0.23 (from jinja2>=2.10.3->homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/MarkupSafe-1.1.1-cp37-none-any.whl
Collecting yarl<2.0,>=1.0 (from aiohttp==3.6.1->homeassistant)
  Downloading https://wheels.home-assistant.io/alpine-3.10/armv7/yarl-1.4.2-cp37-none-any.whl (255kB)
Collecting multidict<5.0,>=4.5 (from aiohttp==3.6.1->homeassistant)
  Downloading https://files.pythonhosted.org/packages/b6/22/ae21cedaa0e6d35e84e8ab57700dcf3d4609421ebe113e1aaafc468eec42/multidict-4.7.4.tar.gz (50kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting chardet<4.0,>=2.0 (from aiohttp==3.6.1->homeassistant)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests==2.22.0->homeassistant)
  Downloading https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl (125kB)
Collecting idna<2.9,>=2.5 (from requests==2.22.0->homeassistant)
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
Requirement already satisfied: pycparser in /usr/local/lib/python3.7/site-packages (from cffi>=1.1->bcrypt==3.1.7->homeassistant) (2.19)
Collecting more-itertools (from zipp>=0.5->importlib-metadata==0.23->homeassistant)
  Downloading https://files.pythonhosted.org/packages/bc/e2/3206a70758a21f9878fcf9478282bb68fbc66a5564718f9ed724c3f2bb52/more_itertools-8.1.0-py3-none-any.whl (41kB)
Building wheels for collected packages: multidict
  Building wheel for multidict (PEP 517): started
  Building wheel for multidict (PEP 517): finished with status 'error'
  Running setup.py clean for multidict
Failed to build multidict

I was having the same error yesterday (using the check home assistant configuration add-on ), but today it seems to work fine. Nevertheless the real upgrade fails somehow as hassio keeps reverting back to the old version.

Hello John , we also ran in to same problem. The problem is with the latest release of multidict 4.7.4 (Jan 12) - Just force the multidict to use the 4.7.3 (dec 30 2019) version in requirements.txt it will work. (looks like some bug in the latest multidict release)

Thanks @UjvalShahTraveloka. Any idea how I would do this in Hass.io ?

I have problem to build alexapy library on HASSIO 0.104.1

Well, I’m new with linux, could you be more specific how to force multidict to use this older version. Thanks in advance.

I’m running HomeAssistant via Raspberry Pi with auto-started containers and I admit to being unclear where / how to install packages like insteonplm. But in any case from within an SSH terminal session I issued the following commands and got around the dependency problem that insteonplm has on multidict and gcc.

When executed within a terminal supported by the HA OpenSSH server these commands are only valid while the container stays running. They need to be re-issued when the container or the host are restarted.

~ $ apk add python3
~ $ apk add python3-dev
~ $ apk add gcc musl-dev
~ $ pip3 install insteonplm (for example)

Full output from the OpenSSH session is here:

 _    _                                         _     _              _
| |  | |                          /\           (_)   | |            | |
| |__| | ___  _ __ ___   ___     /  \   ___ ___ _ ___| |_ __ _ _ __ | |_
|  __  |/ _ \| '_ ` _ \ / _ \   / /\ \ / __/ __| / __| __/ _` | '_ \| __|
| |  | | (_) | | | | | |  __/  / ____ \\__ \__ \ \__ \ || (_| | | | | |_
|_|  |_|\___/|_| |_| |_|\___| /_/    \_\___/___/_|___/\__\__,_|_| |_|\__|


Our command line:
$ hassio help

~ $ apk add python3
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/armv7/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/armv7/APKINDEX.tar.gz
(1/5) Installing libbz2 (1.0.8-r1)
(2/5) Installing libffi (3.2.1-r6)
(3/5) Installing gdbm (1.13-r1)
(4/5) Installing sqlite-libs (3.30.1-r1)
(5/5) Installing python3 (3.8.1-r0)
Executing busybox-1.31.1-r8.trigger
OK: 132 MiB in 72 packages

~ $ apk add python3-dev
(1/1) Installing python3-dev (3.8.1-r0)
Executing busybox-1.31.1-r8.trigger
OK: 172 MiB in 73 packages

~ $ apk add gcc musl-dev
(1/9) Installing binutils (2.33.1-r0)
(2/9) Installing gmp (6.1.2-r1)
(3/9) Installing isl (0.18-r0)
(4/9) Installing libgomp (9.2.0-r3)
(5/9) Installing libatomic (9.2.0-r3)
(6/9) Installing mpfr4 (4.0.2-r1)
(7/9) Installing mpc1 (1.1.0-r1)
(8/9) Installing gcc (9.2.0-r3)
(9/9) Installing musl-dev (1.1.24-r0)
Executing busybox-1.31.1-r8.trigger
OK: 232 MiB in 82 packages

~ $ pip3 install insteonplm
Collecting insteonplm
  Downloading https://files.pythonhosted.org/packages/cf/03/e4f171bca020909e82cc9c98bdeb5dd698c0e4cea824486f9236350e92d9/insteonplm-0.16.6.tar.gz (96kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 102kB 1.8MB/s
Collecting pyserial==3.2.0 (from insteonplm)
  Downloading https://files.pythonhosted.org/packages/2c/c2/2a391a69730c05a646f27e71e965cf8a0e9ccd72c0f0b870b74d47f3c32b/pyserial-3.2-py2.py3-none-any.whl (189kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 194kB 3.5MB/s
Collecting pyserial-asyncio (from insteonplm)
  Downloading https://files.pythonhosted.org/packages/d5/5e/518ace81b212db9a6458bf86ae9626c850bdc06ab133edd11f9b2a29ec47/pyserial_asyncio-0.4-py3-none-any.whl
Collecting async_timeout (from insteonplm)
  Downloading https://files.pythonhosted.org/packages/e1/1e/5a4441be21b0726c4464f3f23c8b19628372f606755a9d2e46c187e65ec4/async_timeout-3.0.1-py3-none-any.whl
Collecting aiohttp (from insteonplm)
  Downloading https://files.pythonhosted.org/packages/c2/f7/f0ad3dbace4762fef5d80aa4124b41bf218e4c4dd6d387a86cede707d9a4/aiohttp-3.6.2-py3-none-any.whl (441kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 450kB 3.9MB/s
Collecting yarl<2.0,>=1.0 (from aiohttp->insteonplm)
  Downloading https://files.pythonhosted.org/packages/d6/67/6e2507586eb1cfa6d55540845b0cd05b4b77c414f6bca8b00b45483b976e/yarl-1.4.2.tar.gz (163kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 163kB 3.3MB/s
Collecting attrs>=17.3.0 (from aiohttp->insteonplm)
  Downloading https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting chardet<4.0,>=2.0 (from aiohttp->insteonplm)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 143kB 4.7MB/s
Collecting multidict<5.0,>=4.5 (from aiohttp->insteonplm)
  Downloading https://files.pythonhosted.org/packages/b6/22/ae21cedaa0e6d35e84e8ab57700dcf3d4609421ebe113e1aaafc468eec42/multidict-4.7.4.tar.gz (50kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 51kB 3.6MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting idna>=2.0 (from yarl<2.0,>=1.0->aiohttp->insteonplm)
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 61kB 2.8MB/s
Building wheels for collected packages: multidict
  Building wheel for multidict (PEP 517) ... done
  Created wheel for multidict: filename=multidict-4.7.4-cp38-cp38-linux_armv7l.whl size=144110 sha256=38d4af426f58e29632bde38dd2a3216f3f1a773bccc389313c875f2a315b7bce
  Stored in directory: /root/.cache/pip/wheels/42/b1/25/4bb96a44eee63c39b3f41f33ee80bfb108a6f36f722bf1a06f
Successfully built multidict
Installing collected packages: pyserial, pyserial-asyncio, async-timeout, multidict, idna, yarl, attrs, chardet, aiohttp, insteonplm
  Running setup.py install for yarl ... done
  Running setup.py install for insteonplm ... done
Successfully installed aiohttp-3.6.2 async-timeout-3.0.1 attrs-19.3.0 chardet-3.0.4 idna-2.8 insteonplm-0.16.6 multidict-4.7.4 pyserial-3.2 pyserial-asyncio-0.4 yarl-1.4.2
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
~ $