Python-openzwave on Mac OSX

Has anyone successfully installed python-openzwave on Mac OSX? The compile fails for me at the udev stage. OSX does not use udev so I am stumped as to how to bypass udev and continue with compile. Any suggestions?

1 Like

Hi,

I filed in an issue (#41) @python-openzwave.

Removing ‘UDEV’ from setup-lib.py (be sure to remove all 3 entries) does fix it.

Unfortunately the install process stops with this error:

  File "/tmp/easy_install-6y8tlbhe/gevent-1.0.2/setup.py", line 111, in make_universal_header
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'
make: *** [install] Error 1

Any help is appreciated, thanks.

UDEV & gevent errors are gone (see #41) but still not working with Home Assistant:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/libopenzwave-0.3.0b8-py3.5-macosx-10.6-intel.egg/libopenzwave.cpython-35m-darwin.so, 2): Symbol not found: __ZN9OpenZWave7Manager11SetNodeNameEjhRKSs
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/libopenzwave-0.3.0b8-py3.5-macosx-10.6-intel.egg/libopenzwave.cpython-35m-darwin.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/libopenzwave-0.3.0b8-py3.5-macosx-10.6-intel.egg/libopenzwave.cpython-35m-darwin.so

Hi, has anyone get this working on a mac? please share the install methode.

Making a little progress. Seems that the python-openzwave will now compile and install. The problem is that HA bails because python-openzwave is compiled against OSX 10.11 but libraries like gevent are compiled against 10.6 and HA is throwing an error because of this. Not really sure how to proceed.

Ok, got it! After blowing away my entire python3 install because of another issue I reinstalled python3 using brew. This has the effect of installing it in /usr/local/lib/python3.5 instead of /Library…

$ brew install python3

I should also mention that I installed open-zwave with brew as well. Next I installed home-assistant using pip3.

$ sudo -H pip3 install homeassistant

Made sure it was up and working, and then did the following.

$ git clone https://github.com/Cython/cython.git
$ cd cython
$ sudo -H python3 setup.py install

This builds cython and all its dependancies against OSX 10.11 instead of using the 10.6 build that is in the brew install.

Then I used the instructions from the HA ZWave site.

$ git clone https://github.com/OpenZWave/python-openzwave.git
$ cd python-openzwave
$ git checkout python3
$ PYTHON_EXEC=which python3 make build
$ sudo PYTHON_EXEC=which python3 make install

Now it’s up and running and sees the Aeon Z-Stick and the Door/Window sensor. Now the only problem I am having is that HA is not seeing the binary state of the binary sensor it created. That is another fight for this week. Just glad HA can see the damned thing.

Gook Luck.

1 Like

Amazing! :tada:So you have now python-openzwave working on HA?
You should write a step-by-step guide and post it in the main page, for those of us who use/have an OSX machine.

This is pretty much the same method I used as well this evening and can confirm. I was able to simply:

$ pip3 install python

My config path ended up looking like this:

zwave:
  usb_path: /dev/cu.usbmodem1411
  config_path: /usr/local/lib/python3.5/site-packages/libopenzwave-0.3.0b9-py3.5-macosx-10.11-x86_64.egg/config/

HI,

Yep mine looks similar. Think its diff cause I have a Gen5 Z-Stick.

zwave:
usb_path: /dev/cu.usbmodem4741
config_path: /usr/local/lib/python3.5/site-packages/libopenzwave-0.3.0b9-py3.5-macosx-10.11-x86_64.egg/config

Going to update my post on Bsic vs Binary in a sec but will note here that I finally got the Door/Window sensor switched over to binary After attempting to use both python-open-zwave and open-zwave-control-panel on the Mac, Ubuntu VM, and my Rasberry the pozw on the Rasberry won. Although I think it was having to press the zwave button on the Door/Window sensor to wake it up before sending the set command caused it to work. Don’t have the balls to play with it on the Mac as its working and I don’t want to mess it up, but will post either success or failure when I purchase the next one.

Hi, can confirm that the above howto works. :grin:

:sweat: I tried last night and the last 2 steps gave me a compilation error.

Maybe I’ll have to uninstall python3 completely and start again.

What’s the best way to uninstall it?

Depends on how you installed it and what you are doing with python3. As HA and related were the only things I was doing with python3 on my Mac I felt comfortable searching for and deleting the folder “python3.5” I found in /Library on the Mac. I then installed with brew so that it is now located in /usr/local/lib. What kind of compile errors were you getting?

Sorry, didn’t update with news (weekend :wink:)
I installed Python3 with brew, located it and used that path instead of the default that ‘which python’ gets on PYTHON_EXEC.
It compiled correctly I guess, I will try this week, because first I have to stop my current installation of HA on the Pi that is actually running.

Bad news :worried:
After trying to compile again python-openzwave because my usb stick not being recognized, I’m getting this errors at the end.

3 warnings generated.
Linking /Users/dani/python-openzwave/openzwave/.lib/MinOZW
g++  -arch i386 -arch x86_64 -o /Users/dani/python-openzwave/openzwave/.lib/MinOZW /Users/dani/python-openzwave/openzwave/.lib/Main.o /Users/dani/python-openzwave/openzwave/libopenzwave-1.4.dylib /Users/dani/python-openzwave/openzwave/libopenzwave.dylib -pthread
clang: warning: argument unused during compilation: '-pthread'
Creating Temporary Shell Launch Script
which python3 setup-lib.py build
/usr/local/bin/python3
make: *** [build] Error 1

I’ve moved the /Library/Framework/Python folder to a backup, installed Python3 from brew (which python3 gives me /usr/local/bin/python3) but no way.
Any ideas?

Are you using sudo to do the make install? Other than that I am not sure what exactly might be happening.

I’m trying to get this to work by following the above, and am getting lots of errors. Perhaps I need to remove every Python-y thing I can find first, and just try again.

How do I even remove Python? I installed it like this, I think:
git clone https://github.com/OpenZWave/python-openzwave.git

Did you get it going?

At this step: PYTHON_EXEC=which python3 make build

I get this error: MacMini:python-openzwave ChopOMatic$ PYTHON_EXEC=which python3 make build
/Library/Frameworks/Python.framework/Versions/3.5/Resources/Python.app/Contents/MacOS/Python: can’t open file ‘make’: [Errno 2] No such file or directory

Any ideas?

Hi,

I’m getting all the way through except at the end.

Processing dependencies for libopenzwave==0.3.1
Searching for six
Reading https://pypi.python.org/simple/six/
Download error on https://pypi.python.org/simple/six/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) – Some packages may not be found!
Couldn’t find index page for ‘six’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https: // pypi. python. org/ simple/
Download error on https: / /pypi. python.org /simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) – Some packages may not be found!
No local packages or working download links found for six
error: Could not find suitable distribution for Requirement.parse(‘six’)
make: *** [install-lib] Error 1

Hi,

Followed all your instructions and got all the way through except until the end when I issued the sudo PYTHON_EXEC=which python3 make install command.

Processing dependencies for libopenzwave==0.3.1
Searching for six
Reading https:// pypi.python. org/simple/six/
Download error on https: //pypi. python.org/simple/six/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) – Some packages may not be found!
Couldn’t find index page for ‘six’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) – Some packages may not be found!
No local packages or working download links found for six
error: Could not find suitable distribution for Requirement.parse(‘six’)
make: *** [install-lib] Error 1