Can't update 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:
Collecting homeassistant
  Downloading (6.0MB)
Collecting async-timeout==3.0.1 (from homeassistant)
Collecting bcrypt==3.1.7 (from homeassistant)
  Downloading (57kB)
Collecting pytz>=2019.03 (from homeassistant)
  Downloading (509kB)
Collecting voluptuous==0.11.7 (from homeassistant)
Collecting cryptography==2.8 (from homeassistant)
  Downloading (877kB)
Collecting importlib-metadata==0.23 (from homeassistant)
Collecting python-slugify==4.0.0 (from homeassistant)
Collecting ruamel.yaml==0.15.100 (from homeassistant)
  Downloading (656kB)
Collecting jinja2>=2.10.3 (from homeassistant)
  Downloading (125kB)
Collecting astral==1.10.1 (from homeassistant)
Collecting aiohttp==3.6.1 (from homeassistant)
  Downloading (1.2MB)
Collecting PyJWT==1.7.1 (from homeassistant)
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 (44kB)
Collecting voluptuous-serialize==2.3.0 (from homeassistant)
Collecting requests==2.22.0 (from homeassistant)
  Downloading (57kB)
Collecting attrs==19.3.0 (from homeassistant)
Collecting certifi>=2019.9.11 (from homeassistant)
  Downloading (156kB)
Collecting six>=1.4.1 (from bcrypt==3.1.7->homeassistant)
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)
Collecting text-unidecode>=1.3 (from python-slugify==4.0.0->homeassistant)
  Downloading (78kB)
Collecting MarkupSafe>=0.23 (from jinja2>=2.10.3->homeassistant)
Collecting yarl<2.0,>=1.0 (from aiohttp==3.6.1->homeassistant)
  Downloading (255kB)
Collecting multidict<5.0,>=4.5 (from aiohttp==3.6.1->homeassistant)
  Downloading (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 (133kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests==2.22.0->homeassistant)
  Downloading (125kB)
Collecting idna<2.9,>=2.5 (from requests==2.22.0->homeassistant)
  Downloading (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 (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 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 ?

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
(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 (96kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 102kB 1.8MB/s
Collecting pyserial==3.2.0 (from insteonplm)
  Downloading (189kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 194kB 3.5MB/s
Collecting pyserial-asyncio (from insteonplm)
Collecting async_timeout (from insteonplm)
Collecting aiohttp (from insteonplm)
  Downloading (441kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 450kB 3.9MB/s
Collecting yarl<2.0,>=1.0 (from aiohttp->insteonplm)
  Downloading (163kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 163kB 3.3MB/s
Collecting attrs>=17.3.0 (from aiohttp->insteonplm)
Collecting chardet<4.0,>=2.0 (from aiohttp->insteonplm)
  Downloading (133kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 143kB 4.7MB/s
Collecting multidict<5.0,>=4.5 (from aiohttp->insteonplm)
  Downloading (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 (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 install for yarl ... done
  Running 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.
~ $