home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.98k stars 7.29k forks source link

'hass' command fails on WSL2 #30097

Closed wwwizzarrdry closed 5 months ago

wwwizzarrdry commented 11 months ago

Feedback

Everything works until you try to run home assistant. Running $ hass fails on Unable to install package aiodiscover==1.5.1

(homeassistant) homeassistant@HADES:/srv/homeassistant$ hass
2023-12-01 15:43:53.791 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //home/homeassistant/.homeassistant/home-assistant_v2.db was shutdown cleanly
2023-12-01 15:43:53.804 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=5 from 2023-12-01 21:24:54.846332)
2023-12-01 15:43:56.664 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package aiodiscover==1.5.1: error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      /srv/homeassistant/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_ext
      checking for getifaddrs...found.
      checking for getnameinfo...found.
      checking for IPv6 socket IOCTLs...not found.
      checking for optional header files...netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h netrose/rose.h linux/atm.h linux/llc.h linux/tipc.h.
      checking whether struct sockaddr has a length field...no.
      checking which sockaddr_xxx structs are defined...at ax25 in in6 ipx un rose ash ec ll atmpvc atmsvc llc.
      checking for routing socket support...no.
      checking for sysctl(CTL_NET...) support...no.
      checking for netlink support...yes.
      will use netlink to read routing table
      building 'netifaces' extension
      x86_64-linux-gnu-gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DNETIFACES_VERSION=0.11.0 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_NETROSE_ROSE_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ROSE=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/srv/homeassistant/include -I/usr/include/python3.11 -c netifaces.c -o build/temp.linux-x86_64-cpython-311/netifaces.o
      netifaces.c:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for netifaces
ERROR: Could not build wheels for netifaces, which is required to install pyproject.toml-based projects
2023-12-01 15:43:59.627 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package aiodiscover==1.5.1: error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      /srv/homeassistant/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_ext
      checking for getifaddrs...found.
      checking for getnameinfo...found.
      checking for IPv6 socket IOCTLs...not found.
      checking for optional header files...netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h netrose/rose.h linux/atm.h linux/llc.h linux/tipc.h.
      checking whether struct sockaddr has a length field...no.
      checking which sockaddr_xxx structs are defined...at ax25 in in6 ipx un rose ash ec ll atmpvc atmsvc llc.
      checking for routing socket support...no.
      checking for sysctl(CTL_NET...) support...no.
      checking for netlink support...yes.
      will use netlink to read routing table
      building 'netifaces' extension
      x86_64-linux-gnu-gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DNETIFACES_VERSION=0.11.0 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_NETROSE_ROSE_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ROSE=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/srv/homeassistant/include -I/usr/include/python3.11 -c netifaces.c -o build/temp.linux-x86_64-cpython-311/netifaces.o
      netifaces.c:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for netifaces
ERROR: Could not build wheels for netifaces, which is required to install pyproject.toml-based projects
2023-12-01 15:44:03.025 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package aiodiscover==1.5.1: error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      /srv/homeassistant/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_ext
      checking for getifaddrs...found.
      checking for getnameinfo...found.
      checking for IPv6 socket IOCTLs...not found.
      checking for optional header files...netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h netrose/rose.h linux/atm.h linux/llc.h linux/tipc.h.
      checking whether struct sockaddr has a length field...no.
      checking which sockaddr_xxx structs are defined...at ax25 in in6 ipx un rose ash ec ll atmpvc atmsvc llc.
      checking for routing socket support...no.
      checking for sysctl(CTL_NET...) support...no.
      checking for netlink support...yes.
      will use netlink to read routing table
      building 'netifaces' extension
      x86_64-linux-gnu-gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DNETIFACES_VERSION=0.11.0 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_NETROSE_ROSE_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ROSE=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/srv/homeassistant/include -I/usr/include/python3.11 -c netifaces.c -o build/temp.linux-x86_64-cpython-311/netifaces.o
      netifaces.c:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for netifaces
ERROR: Could not build wheels for netifaces, which is required to install pyproject.toml-based projects
2023-12-01 15:44:03.025 ERROR (MainThread) [homeassistant.setup] Setup failed for dhcp: Requirements for dhcp not found: ['aiodiscover==1.5.1'].
2023-12-01 15:44:03.772 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: dhcp
2023-12-01 15:44:03.772 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: dhcp')

URL

https://www.home-assistant.io/installation/windows/

Version

2023.11.3

Additional information

No response

vamshi85 commented 7 months ago

Followed the steps and got the same error, is there any solution available for this?

frenck commented 5 months ago
      netifaces.c:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~

The Python environment you have set up seems to be missing the development headers.

As per the documentation you have linked:

CleanShot 2024-05-23 at 19 10 23@2x

Please make sure you install those.

../Frenck