DeConz integration fail: "No module named 'pydeconz'"

Sunk costs fallacy

You can either:

  1. Get up and running quickly using another install method
  2. Spend longer trying to fix your current install

However, fixing your current install will require you explain what that failed with a ton of errors actually means. Share those errors, or we’re just guessing.

Thanks. I tried to paste the output from python3 -m pip install homeassistant-pyozw==0.1.10, but it’s 110kB and the forum only allows me to paste 32kB, or upload images. So I’m just pasting an extract:

Collecting homeassistant-pyozw==0.1.10
  Using cached homeassistant_pyozw-0.1.10.zip (147 kB)
Requirement already satisfied: six in /root/homeassistant/lib/python3.8/site-packages (from homeassistant-pyozw==0.1.10) (1.15.0)
Requirement already satisfied: PyDispatcher>=2.0.5 in /root/homeassistant/lib/python3.8/site-packages (from homeassistant-pyozw==0.1.10) (2.0.5)
Using legacy 'setup.py install' for homeassistant-pyozw, since package 'wheel' is not installed.
Installing collected packages: homeassistant-pyozw
    Running setup.py install for homeassistant-pyozw: started
    Running setup.py install for homeassistant-pyozw: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /root/homeassistant/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/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-record-xlo42l1n/install-record.txt --single-version-externally-managed --compile --install-headers /root/homeassistant/include/site/python3.8/homeassistant-pyozw
         cwd: /tmp/pip-install-jhi3l_7r/homeassistant-pyozw/
    Complete output (776 lines):
    ImportError in : from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
    sysargv ['/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/setup.py', 'install', '--record', '/tmp/pip-record-xlo42l1n/install-record.txt', '--single-version-externally-managed', '--compile', '--install-headers', '/root/homeassistant/include/site/python3.8/homeassistant-pyozw']
    Found SETUP_DIR : /tmp/pip-install-jhi3l_7r/homeassistant-pyozw
    NameError in : class bdist_wheel(_bdist_wheel) - Use bdist_egg instead
    <pyozw_setup.EmbedTemplate object at 0x7f8de6f6a070>
    {'name': 'libopenzwave', 'sources': ['openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp'], 'include_dirs': ['src-lib/libopenzwave/', 'openzwave-embed/open-zwave-hass/cpp/src', 'openzwave-embed/open-zwave-hass/cpp/src/value_classes', 'openzwave-embed/open-zwave-hass/cpp/src/platform', 'openzwave-embed/open-zwave-hass/cpp/build/linux'], 'define_macros': [('PY_LIB_VERSION', '0.1.10'), ('PY_SSIZE_T_CLEAN', 1), ('PY_LIB_FLAVOR', 'embed'), ('PY_LIB_BACKEND', 'cpp')], 'libraries': ['udev', 'stdc++', 'resolv'], 'extra_objects': ['openzwave-embed/open-zwave-hass/libopenzwave.a'], 'extra_compile_args': [], 'extra_link_args': [], 'language': 'c++'}
    ['six', 'PyDispatcher>=2.0.5']
    running install

[snip]

    Build openzwave ... be patient ...
    b'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/cpp/hidapi/linux/hid.c:46:10: fatal error: libudev.h: No such file or directory\n'
    b'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/cpp/hidapi/linux/hid.c:46:10: fatal error: libudev.h: No such file or directory\n'
    
    b' #include <libudev.h>\n'
    b' #include <libudev.h>\n'
    
    b'          ^~~~~~~~~~~\n'
    b'          ^~~~~~~~~~~\n'
    
    b'compilation terminated.\n'
    b'compilation terminated.\n'
    
    b'make[1]: *** [/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/cpp/build/support.mk:164: /tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/.lib/hid.o] Error 1\n'
    b'make[1]: *** [/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/cpp/build/support.mk:164: /tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/.lib/hid.o] Error 1\n'
    
    b'make: *** [Makefile:20: all] Error 2\n'
    b'make: *** [Makefile:20: all] Error 2\n'

[snip]

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_LIB_VERSION=0.1.10 -DPY_SSIZE_T_CLEAN=1 -DPY_LIB_FLAVOR=embed -DPY_LIB_BACKEND=cpp -Isrc-lib/libopenzwave/ -Iopenzwave-embed/open-zwave-hass/cpp/src -Iopenzwave-embed/open-zwave-hass/cpp/src/value_classes -Iopenzwave-embed/open-zwave-hass/cpp/src/platform -Iopenzwave-embed/open-zwave-hass/cpp/build/linux -I/root/homeassistant/include -I/usr/local/include/python3.8 -c openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp -o build/temp.linux-x86_64-3.8/openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.o
    openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp:3: warning: "PY_SSIZE_T_CLEAN" redefined
     #define PY_SSIZE_T_CLEAN
    
    <command-line>: note: this is the location of the previous definition
    openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp: In function ‘PyObject* __pyx_pf_12libopenzwave_9PyManager_272beginControllerCommand(__pyx_obj_12libopenzwave_PyManager*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*)’:
    openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp:31718:204: warning: ‘bool OpenZWave::Manager::BeginControllerCommand(uint32, OpenZWave::Driver::ControllerCommand, OpenZWave::Driver::pfnControllerCallback_t, void*, bool, uint8, uint8)’ is deprecated [-Wdeprecated-declarations]
       __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->manager->BeginControllerCommand(__pyx_t_1, __pyx_t_2, __pyx_f_12libopenzwave_ctrl_callback, ((void *)__pyx_v_pythonfunc), __pyx_t_3, __pyx_t_4, __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4207, __pyx_L1_error)
                                                                                                                                                                                                                ^
    In file included from openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp:628:
    openzwave-embed/open-zwave-hass/cpp/src/Manager.h:1732:19: note: declared here
       DEPRECATED bool BeginControllerCommand( uint32 const _homeId, Driver::ControllerCommand _command, Driver::pfnControllerCallback_t _callback = NULL, void* _context = NULL, bool _highPower = false, uint8 _nodeId = 0xff, uint8 _arg = 0 );
                       ^~~~~~~~~~~~~~~~~~~~~~
    g++ -pthread -shared build/temp.linux-x86_64-3.8/openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.o openzwave-embed/open-zwave-hass/libopenzwave.a -ludev -lstdc++ -lresolv -o build/lib.linux-x86_64-3.8/libopenzwave.cpython-38-x86_64-linux-gnu.so
    g++: error: openzwave-embed/open-zwave-hass/libopenzwave.a: No such file or directory
    error: command 'g++' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /root/homeassistant/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/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-record-xlo42l1n/install-record.txt --single-version-externally-managed --compile --install-headers /root/homeassistant/include/site/python3.8/homeassistant-pyozw Check the logs for full command output.

The rest of the output looks normal to me, this is the only error output as far as I can tell. Happy to post the entire output, but it may require three or four separate posts and I don’t want to spam.

You can use code sharing sites :wink:

The problem looks like a missing library - libopenzwave.a

Maybe instead switch to ozw, which is the new Z-Wave integration that will fully replace zwave in the near future.

Thanks. Running

apt install libopenzwave1.5
apt install libopenzwave1.5-dev
apt install libudev-dev

before installing homeassistant-pyozw seems to have fixed it (cf. also https://github.com/home-assistant/core/issues/23028). Let’s see if I get any further now.

No one here in the thread advised you to do a fresh install in a venv, in contrary Tinkerer, Robban and I all said multiple times that you should choose a different install method. I merely pointed you to the docs on how to update a venv.

If you would have followed this advice, you’d be up and running already. I’d say with your background in linux, the whole install including setting up Z-Wave will take you less than 1 hour (+ time to download and install, which depends on your bandwidth and power of the machine).

1 Like

You’ll continue running into problems like this and other dependency issues and then you need to upgrade python and so on.
I say you won’t get happy with a venv install, because you said that you don’t want to fiddle with it all the time and it should just work. Also now when you get this running, you’ll discover some new stuff in home assistant, like add-ons, automatic snapshots etc., which is not available in a venv, in a venv you need to do all this stuff yourself, which is of course possible, but it’s more complicated and will make you fiddle way more with your system than you planned to.

1 Like

The venv install seems to work fine and well enough for me to be able to evaluate it. I’ve been able to get Z-Wave now to work, and in the new version, DeConz also seems to work for me (after some fiddling - although I installed it as root, it made the deconz service run as a regular user, which I had to add to the dialout group, and the documentation for that was well hidden, but it works now).

The system seems to work well enough for me to be able to see how it works, and to be able to read sensors and control actuators via both Z-Wave and Zigbee, but now I’m finding I can’t configure Z-Wave parameters of some configurable devices, but that’s perhaps a question for another thread.

Thanks for helping me get it sorted out this far.

2 Likes