Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python_openzwave fails to install if cython is missing. #12293

Closed
andrewfoster opened this issue Feb 11, 2018 · 17 comments
Closed

python_openzwave fails to install if cython is missing. #12293

andrewfoster opened this issue Feb 11, 2018 · 17 comments

Comments

@andrewfoster
Copy link

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):

0.63.0

Python release (python3 --version):

Python 3.6.4

Component/platform:

zwave

Description of problem:

After upgrading to 0.63.0 zwave fails to upgrade to python_openzwave 0.4.3

2018-02-11 17:37:02 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package python_openzwave==0.4.3: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-tdgs7252/python-openzwave/

I can see the attempted installation:

/usr/local/bin/python3.6 -m pip install --quiet python_openzwave==0.4.3 --upgrade

Attempting this manually results in this error:

$ /usr/local/bin/python3.6 -m pip install python_openzwave==0.4.3 --upgrade
Collecting python_openzwave==0.4.3
  Using cached python_openzwave-0.4.3.zip
    Complete output from command python setup.py egg_info:
    ImportError in : from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
    NameError in : class bdist_wheel(_bdist_wheel) - Use bdist_egg instead
    Can't find Cython
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-g6uokdfe/python-openzwave/setup.py", line 43, in <module>
        print(current_template.ctx)
      File "/tmp/pip-build-g6uokdfe/python-openzwave/pyozw_setup.py", line 226, in ctx
        self.finalize_context(self._ctx)
      File "/tmp/pip-build-g6uokdfe/python-openzwave/pyozw_setup.py", line 247, in finalize_context
        ctx['define_macros'] += [('PY_LIB_FLAVOR', self.flavor.replace('--flavor=',''))]
    TypeError: 'NoneType' object is not subscriptable
    sysargv ['-c', 'egg_info', '--egg-base', 'pip-egg-info']
    <pyozw_setup.SharedTemplate object at 0x8066c7f60>

Installing cython manually solves this, allowing python_openzwave to install.

/usr/local/bin/python3.6 -m pip install python_openzwave==0.4.3
Collecting python_openzwave==0.4.3
  Using cached python_openzwave-0.4.3.zip
Requirement already satisfied: six in /usr/local/lib/python3.6/site-packages (from python_openzwave==0.4.3)
Requirement already satisfied: PyDispatcher>=2.0.5 in /usr/local/lib/python3.6/site-packages (from python_openzwave==0.4.3)
Requirement already satisfied: Cython in /usr/local/lib/python3.6/site-packages (from python_openzwave==0.4.3)
Installing collected packages: python-openzwave
  Running setup.py install for python-openzwave ... done
Successfully installed python-openzwave-0.4.3

Expected:

python_openzwave installs

Problem-relevant configuration.yaml entries and steps to reproduce:

Traceback (if applicable):

Additional info:

@MartinHjelmare
Copy link
Member

How did you install home assistant?

@andrewfoster
Copy link
Author

Upgraded using pip3 install --upgrade homeassistant on FreeBSD 10.4-RELEASE

@Instagraeme
Copy link

Instagraeme commented Feb 11, 2018

After installing cython I get the following. I've also tried a fresh venv and get the same result.

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zwave/__init__.py", line 252, in setup
    from openzwave.option import ZWaveOption
  File "/srv/homeassistant/lib/python3.5/site-packages/openzwave/option.py", line 29, in <module>
    import libopenzwave
ImportError: /srv/homeassistant/lib/python3.5/site-packages/libopenzwave.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZN9OpenZWave7Manager16GetNodeProductIdB5cxx11Ejh

@MartinHjelmare
Copy link
Member

Is the installation procedure of home assistant on FreeBSD documented in our docs?

According to the python-openzwave readme some systems might need cython pre install.

https://github.com/OpenZWave/python-openzwave/blob/master/README.rst

At the same time it says that cython is not needed if the default flavor of install is used.

At minimum we could add a note somewhere in our Z-wave docs that some systems might need cython.

@Instagraeme
Copy link

In my case I am using Debian 9.3 with Python 3.5.3.

@MartinHjelmare
Copy link
Member

@andrewfoster are you getting the same error as @Instagraeme upon home assistant start?

If not, that might be unrelated and require a different issue.

@andrewfoster
Copy link
Author

@MartinHjelmare No, the error I get is the “Unable to install package ...” one mentioned in the initial post on the issue. Sounds like @Instagraeme has a different issue.

As for the dependency, thanks I now see it mentioned on the python-openzwave read me, but prior to upgrading to this release of hass I didn’t have to install cython. Given the upgrade/startup of hass handles other dependencies it seems reasonable that it should handle this one, or at least throw an error that helps the user track down what the problem is.

In cases like this it’d be nice if hass re-ran the failing pip install command without the quiet option so the user can see the error too (I had to run ps repeatedly during hass startup, grepping for pip until I could see what was being run).

@sj3fk3
Copy link

sj3fk3 commented Feb 11, 2018

I have the same problem running HA on: Ubuntu 16.04.3 LTS xenial

after pip3 install Cython (and restart of HA) I get an error that python_openzwave can't find libopenzwave.so.1.4

@MartinHjelmare
Copy link
Member

Please file another issue. It's not documented in the original issue.

@remkolodder
Copy link

I have the same issue on a raspberry running rasbian.

2018-02-13 13:01:39 ERROR (MainThread) [homeassistant.setup] Error during setup of component zwave
Traceback (most recent call last):
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
component.setup, hass, processed_config)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in iter
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/components/zwave/init.py", line 252, in setup
from openzwave.option import ZWaveOption
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/openzwave/option.py", line 29, in
import libopenzwave
ImportError: /home/homeassistant/homeassistant/lib/python3.5/site-packages/libopenzwave.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: _ZN9OpenZWave7Manager16GetNodeProductIdB5cxx11Ejh

@remkolodder
Copy link

Note that I installed cython manually using pip3 install cython from within the venv I am running in. Else python-openzwave didn't install at all.

@MartinHjelmare
Copy link
Member

That's the other issue. We haven't confirmed it's the same cause as in this issue, so let's keep them separated for now.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@photoszzt
Copy link

photoszzt commented Jul 9, 2018

I just hit the same bug. Install cython following the readme and I get the error:

import libopenzwave
ImportError: /home/pi/homeassistant/lib/python3.5/site-packages/libopenzwave.cpython-35m-aarch64-linux-gnu.so: undefined symbol: _ZN9OpenZWave7Manager16GetNodeProductIdB5cxx11Ejh

Without separate installation of cython, I get an error saying that it can't find cython...

The homeassistant version is 0.73.1 which should be most recent version.

@photoszzt
Copy link

photoszzt commented Jul 9, 2018

I uninstall cython and install 0.4.5 version. Then change the homeassistant requirements to 0.4.5 but still no luck:

File "/home/pi/homeassistant/lib/python3.5/site-packages/openzwave/option.py", line 29, in
import libopenzwave
ImportError: /home/pi/homeassistant/lib/python3.5/site-packages/libopenzwave.cpython-35m-aarch64-linux-gnu.so: undefined symbol: _ZN9OpenZWave7Manager16GetNodeProductIdB5cxx11Ejh
20

Update: it seems I have to also install cython. Then the 0.4.5 version works.
Update 2: I do a clean setup again. Seems I have to use
pip install python_openzwave --no-deps --install-option="--flavor=git",
just pip install python_openzwave doesn't work

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@balloobbot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants