No module named 'openzwave'

Hello, I’m trying to configure z-wave on my raspberry pi. I followed the setup instructions, but now that I try to start up HA, I get the following error(s):

16-04-20 23:57:55 homeassistant.bootstrap: Error during setup of component zwave Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 158, in _setup_component if not component.setup(hass, config): File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/zwave.py", line 179, in setup from openzwave.option import ZWaveOption ImportError: No module named 'openzwave' 16-04-20 23:57:56 homeassistant.components.recorder: Found unfinished sessions 16-04-20 23:58:18 homeassistant.bootstrap: Error during setup of component device_tracker Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 158, in _setup_component if not component.setup(hass, config): File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/device_tracker/__init__.py", line 100, in setup seconds=util.convert(conf.get(CONF_CONSIDER_HOME), int, AttributeError: 'list' object has no attribute 'get'

To be clear, HA starts, there’s just no z-wave devices found. Any suggestions of what do to here? I’m a little stumped… Thanks!

AttributeError: 'list' object has no attribute 'get'
Seems like there is a config error, you should post your relevant config

1 Like

Hmmm… Here is what my config.yaml looks like:

#zwave
zwave:
  usb_path: /dev/ttyACM0
  config_path: /home/pi/python-openzwave/openzwave/config
  polling_interval: 6000

If I look at my file structure, the location suggested in the instructions does not exist on the pi:

/usr/local/lib/python3.4/dist-packages/libopenzwave-0.3.0b8-py3.4-linux-x86_64.egg/config

Specifically, there is no libopenzwave-0.3.0b8-py3.4-linux-x86_64.egg file in the ../dist-packages/ folder.

I put the config path that I did, since the config folder was the only one I could find under openzwave.

Are you sure you compiled openzwave according to the instructions? It takes quite some time on a pi.

Is there a way to check the installation?

I thought it went well. I followed the instructions exactly, including all the dependencies, and I did notice it took quite a bit of time.

Can I just attempt to re-compile and install?

@sieropoli How did you get on with this? I have the same error…

You need to have libopenzwave-0.3.0b8-py3.4-linux-x86_64.egg somewhere. Or with the current git you will have libopenzwave-0.3.0b9-py3.4-linux-x86_64.egg (beta 9).

If you are not sure about the path, do sudo updatedb and afterwards locate libopenzwave

Thanks @Christoph-Wagner , I followed your instructions and it can’t find any “libopenzwave ------- .egg” file.

I followed these instructions to install zwave:


Are they still current? I’ll run through them again incase I messed up somewhere. Also as @sieropoli says this path doesn’t exist:
/usr/local/share/python-openzwave/config

but this one does:
/home/pi/python-openzwave/openzwave/config

Thanks

1 Like

The instructions worked for me. It shouldn’t be under any of the paths you mentioned but under /usr/local/lib/python3.4/dist-packages/

Also remember not to compile it as root but use sudo instead.

Thanks for your help @Christoph-Wagner I can now see my zwave components! I went through the build/install again this time using “checkinstall” rather than “make install” and the conf file was in:

/usr/local/lib/python3.4/dist-packages/libopenzwave-0.3.0b9-py3.4-linux-armv7l.egg/config

as you said

:grin:

I’m still having trouble… haven’t been about to figure this out. I tried from scratch again. This time I noticed this error as I tried to compile:

Making ozw_config file
make[2]: Leaving directory '/home/pi/python-openzwave/openzwave/cpp/build'
CPPFLAGS= make -C /home/pi/python-openzwave/openzwave/cpp/examples/MinOZW/ -w
make[2]: Entering directory '/home/pi/python-openzwave/openzwave/cpp/examples/MinOZW'
Building Main.o
Linking /home/pi/python-openzwave/openzwave/.lib/MinOZW
g++   -o /home/pi/python-openzwave/openzwave/.lib/MinOZW /home/pi/python-openzwave/openzwave/.lib/Main.o /home/pi/python-openzwave/openzwave/libopenzwave.so -pthread
Creating Temporary Shell Launch Script
make[2]: Leaving directory '/home/pi/python-openzwave/openzwave/cpp/examples/MinOZW'
make[1]: Leaving directory '/home/pi/python-openzwave/openzwave'
which python3 setup-lib.py build
/usr/bin/python3
Makefile:266: recipe for target 'build' failed
make: *** [build] Error 1

I can’t find any info on the error online. I also tried checkinstall, but get a similar same error.

I tried to run $ sudo python_exec='which python3' make build this time (addition of sudo) and I get a bit more info on the error:

python setup-lib.py build
    Traceback (most recent call last):
      File "setup-lib.py", line 30, in <module>
        from Cython.Distutils import build_ext
    ImportError: No module named Cython.Distutils
    Makefile:266: recipe for target 'build' failed
    make: *** [build] Error 1

I’m getting a bit frustrated so I’m going to take a break and call it a night :slight_smile: !

Hi sieropoli,

I ran into the same issue as you did. Someone on the Home Assistant chatroom suggested the following which worked for me.

Firstly, in the command prompt enter which python

This returned the following: /usr/bin/python3

Then for the make build and make install commands use that location. So those commands would look something like: sudo python_exec=/usr/bin/python3 make build

I deleted the python-openzwave directory and started from scratch and it seemed to work ok.

Good luck

EDIT: Also wanted to mention the when adding the config_path to the config file I used
/usr/local/lib/python3.4/dist-packages/libopenzwave-0.3.0-py3.4-linux-armv7l.egg/config as the path provided in the Home Assistant Z-Wave Components page didn’t work.

Hi soundfx42, thank you very much for your help. I was not expecting that to work, but somehow it did the trick. Thanks again for your help