Failed to build ciso8601 on WSL on Windows 10

Am getting the following error when trying to install Home Assistant on Windows 10 with Python 3.8. Can anyone suggest how to fix?

Building wheels for collected packages: ciso8601
  Building wheel for ciso8601 (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /srv/homeassistant/bin/python3.8 /srv/homeassistant/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/ build_wheel /tmp/tmpohpzfew9
       cwd: /tmp/pip-install-6pgrb52e/ciso8601_167a94d915954737a7b3c59b6a26e024
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  package init file 'ciso8601/' not found (or not a regular file)
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/ciso8601
  copying ciso8601/__init__.pyi -> build/lib.linux-x86_64-3.8/ciso8601
  copying ciso8601/py.typed -> build/lib.linux-x86_64-3.8/ciso8601
  running build_ext
  building 'ciso8601' extension
  creating build/temp.linux-x86_64-3.8
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DCISO8601_VERSION=2.2.0 -DCISO8601_CACHING_ENABLED=1 -I/srv/homeassistant/include -I/usr/include/python3.8 -c module.c -o build/temp.linux-x86_64-3.8/module.o
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ERROR: Failed building wheel for ciso8601
Failed to build ciso8601
ERROR: Could not build wheels for ciso8601, which is required to install pyproject.toml-based projects

Do you have gcc installed under WSL?

1 Like

Ah. I hadn’t explicitly - assumed it would be a dependency. Installed it manually, re-ran it and got a missing Python library error.

I must have missed an error when installing the dependencies. I’ve run them again now and it’s built.


$ sudo apt install python3.9-dev

solved the same problem for me.

1 Like