OpenZWave / python-openzwave

Python wrapper for openzwave
Other
200 stars 141 forks source link

Unable to link on windows #139

Open bls0n opened 6 years ago

bls0n commented 6 years ago

Hi. I have limited coding experience but can edit files and run commands. I get this error when trying to install on Windows 10. Happens with python 35 (32 and 64 bit) and python 36 (32 and 64 bit). Everything goes fine until the 'python setup.py install --flavor=dev' step. Any advice? I'd really like to use homeassistant with openzwave if possible. Thanks!

openzwave/cpp/src\Manager.h(1732): note: see declaration of 'OpenZWave::Manager::BeginControllerCommand' C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\natha\AppData\Local\Programs\Python\Python36\libs /LIBPATH:C:\Users\natha\AppData\Local\Programs\Python\Python36\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\um\x64" setupapi.lib msvcrt.lib ws2_32.lib dnsapi.lib /EXPORT:PyInit_libopenzwave build\temp.win-amd64-3.6\Release\src-lib/libopenzwave\libopenzwave.obj c:\python-openzwave_bak\openzwave\cpp\build\windows\vs2017\x64\Release/OpenZWave.lib /OUT:build\lib.win-amd64-3.6\libopenzwave.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\src-lib/libopenzwave\libopenzwave.cp36-win_amd64.lib LINK : fatal error LNK1181: cannot open input file 'c:\python-openzwave_bak\openzwave\cpp\build\windows\vs2017\x64\Release\OpenZWave.lib' error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\link.exe' failed with exit status 1181

kdschlosser commented 6 years ago

A fix for this error has been merged.

This is what you are going to have to do to get home assistant functioning properly.

Requirements Visual C >= version 12. You can get this if you install Visual Studio Community edition. It is free. You will need to make sure the c compiler is installed. You will have the ability to install the c components when installing VS

You will also need the latest version of setuptools installed in your python installation.

pip install -u setuptools

Download this repository.

python setup.py install --flavor=Dev

This should build and install python_openzwave into your python installation.

You are going to need to modify your home assistant installation. There is a file I believe it has requirements in the filename.

In that file you are going to find a list of all of the modules that home assistant can use. Find the entry for python_openzwave and change the version to match the python_openzwave.

After you do this home assistant will no longer download and install python_openzwave from pipy.

In order to set the comport in hass you will need to use the windows naming convention for the comport virtual file. It is something to the effect of \.\\COM15

I am not currently at my PC. I can give you the specific instructions when I get in front on it. You should be able to get close with the information I have e provided.

kdschlosser commented 6 years ago

How did you make out with this?? Do you need more explicit instructions. I know the above is not the best,

bls0n commented 5 years ago

Still struggling with python setup.py install --flavor=Dev step.

kdschlosser commented 5 years ago

I do not know if you are partial to Home Assistant or not. But if you want to try something else where there is really no coding needed you can give EventGhost a shot It is a HA program that Me and a few others work on. It's an Event/Action based system that has a drag and drop interface. I made a ZWave plugin for it. There are also 400+ other plugins available from interfacing with things like MediaPortal right down to XBox controllers, It also has real time Python scripting available, so it is a good way for you to learn Python as well if you wanted. I feel it is far less complex to get running. And requires 0 programming knowledge to use. Might be a wee bit of a better fit for ya. www.eventghost.net

If you do want to use Home Assistant I can build python_openzwave for ya and write a small script to handle installing it and making any needed changes to home assistant.

which ever way you want to go.

dude0001 commented 5 years ago

@bls0n & @kdschlosser is this still an issue now that needs work now that PR # 150 has been merged?

kdschlosser commented 5 years ago

this will be an issue until the folks over at homeassistant update the python-openzwave version.

dude0001 commented 5 years ago

I already pinged some developers on home-assistant/python-openzwave as several Windows users were struggling getting python-openzwave running in Windows. I thought it made more sense to fix it here first, and then merge it in to the home-assistant/python-openzwave fork so it is fixed everywhere. They are planning to merge the upstream changes home-assistant/python-openzwave PR #1.

I'd say it is safe to close this issue.

kdschlosser commented 5 years ago

make sure you change the docs for home assistant to reflect how to setup the config file for the comport. it is something like .////COM** I think.

veleek commented 5 years ago

@dude0001 - Can this be closed as well? It look like the associated HA PR is closed.

kdschlosser commented 5 years ago

This should be good to go. the linker issue when building with Windows has been resolved in #152