Can't install any dependencies anymore

I’m at a total loss here. After moving from .47 to .49.x no new dependencies install anymore. First I thought it was just the chromecast causing this but after upgrading to .49.1 (thinking this might solve it) also zwave (arghhh) and sysmon is not installing it’s dependencies.

I’m running pre dec 16 AIO

Below is an example of Chromecast but error details are the same for the other two dependencies.

What I tried based on searching the forum:

  • Updated all packages on the PI
  • Delete directories under .cache (not only the pip but also the wheels one, hope this did not break anything else)
  • Trying to manually install (for example) pychromecast in the virtual environment both as HASS and as PI user. (see output as bottom of this post)

Any help really appreciated!

Logfile hass:

2017-07-27 10:02:30 ERROR (Thread-4) [homeassistant.util.package] Unable to install package pychromecast==0.8.1: Command "/srv/hass/hass_venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-kw_9phkh/netifaces/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-o1532zc9-record/install-record.txt --single-version-externally-managed --compile --install-headers /srv/hass/hass_venv/include/site/python3.4/netifaces --home=/tmp/tmpqkcc3t_k" failed with error code 1 in /tmp/pip-build-kw_9phkh/netifaces/

(hass_venv) pi@raspberrypi:~ $ sudo pip install pychromecast

Collecting pychromecast
  Downloading PyChromecast-0.8.2-py2.py3-none-any.whl (40kB)
    100% |████████████████████████████████| 40kB 1.4MB/s
Collecting protobuf>=3.0.0 (from pychromecast)
  Downloading protobuf-3.3.0.tar.gz (271kB)
    100% |████████████████████████████████| 276kB 830kB/s
Collecting zeroconf>=0.17.7 (from pychromecast)
  Downloading zeroconf-0.19.1-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.0 in /usr/local/lib/python3.4/dist-packages (from pychromecast)
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.4/dist-packages (from pychromecast)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from protobuf>=3.0.0->pychromecast)
Collecting enum-compat (from zeroconf>=0.17.7->pychromecast)
  Downloading enum-compat-0.0.2.tar.gz
Collecting netifaces!=0.10.5 (from zeroconf>=0.17.7->pychromecast)
  Downloading netifaces-0.10.6.tar.gz
Installing collected packages: protobuf, enum-compat, netifaces, zeroconf, pychromecast
  Running setup.py install for protobuf ... done
  Running setup.py install for enum-compat ... done
 Running setup.py install for netifaces ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-kcqtu3e6/netifaces/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-8r1q28is-record/install-record.txt --single-version-externally-managed --compile:
    running install
    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 linux/irda.h linux/atm.h linux/llc.h linux/tipc.h linux/dn.h.
    checking whether struct sockaddr has a length field...no.
    checking which sockaddr_xxx structs are defined...at ax25 in in6 ipx un ash ec ll atmpvc atmsvc dn irda 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
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DNETIFACES_VERSION=0.10.6 -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_LINUX_IRDA_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_LINUX_DN_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_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_DN=1 -DHAVE_SOCKADDR_IRDA=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/usr/include/python3.4m -c netifaces.c -o build/temp.linux-armv7l-3.4/netifaces.o
    netifaces.c:1:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-kcqtu3e6/netifaces/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-8r1q28is-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-kcqtu3e6/netifaces/

If I do the same with PSutil (als a dependencies that does not install:

(hass_venv) pi@raspberrypi:~ $ sudo pip install psutil==5.2.2
Collecting psutil==5.2.2
  Downloading psutil-5.2.2.tar.gz (348kB)
    100% |████████████████████████████████| 358kB 740kB/s
Installing collected packages: psutil
  Running setup.py install for psutil ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1_55n5de/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-712aidg9-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.4
    creating build/lib.linux-armv7l-3.4/psutil
    copying psutil/_psbsd.py -> build/lib.linux-armv7l-3.4/psutil
    copying psutil/_psosx.py -> build/lib.linux-armv7l-3.4/psutil
    copying psutil/__init__.py -> build/lib.linux-armv7l-3.4/psutil
    copying psutil/_compat.py -> build/lib.linux-armv7l-3.4/psutil
    copying psutil/_common.py -> build/lib.linux-armv7l-3.4/psutil
    copying psutil/_pslinux.py -> build/lib.linux-armv7l-3.4/psutil
    copying psutil/_pswindows.py -> build/lib.linux-armv7l-3.4/psutil
    copying psutil/_pssunos.py -> build/lib.linux-armv7l-3.4/psutil
    copying psutil/_psposix.py -> build/lib.linux-armv7l-3.4/psutil
    creating build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/runner.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_memory_leaks.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_osx.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.linux-armv7l-3.4/psutil/tests
    copying psutil/tests/test_system.py -> build/lib.linux-armv7l-3.4/psutil/tests
    running build_ext
    building 'psutil._psutil_linux' extension
    creating build/temp.linux-armv7l-3.4
    creating build/temp.linux-armv7l-3.4/psutil
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=522 -DPSUTIL_LINUX=1 -I/usr/include/python3.4m -c psutil/_psutil_linux.c -o build/temp.linux-armv7l-3.4/psutil/_psutil_linux.o
    psutil/_psutil_linux.c:12:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1_55n5de/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-712aidg9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1_55n5de/psutil/

Ok, solved this. Just if others run into this:

ssh into hass with PI user
Install python3 dev:

sudo apt-get install python3-dev

Activate venv:

sudo su -s /bin/bash hass
source /srv/hass/hass_venv/bin/activate

Then install the missing dependencies with pip 3:

pip3 install pychromecast==0.8.1

Still have no idea why I had to install python3 dev again but it worked