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

Support Windows 7 for latest Hass releases #76

Closed
veso266 opened this issue Jun 23, 2023 · 8 comments
Closed

Support Windows 7 for latest Hass releases #76

veso266 opened this issue Jun 23, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@veso266
Copy link

veso266 commented Jun 23, 2023

Hello there, I am trying to buld HassWP myself

like this

python -m pip install homeassistant==2023.5.3
pip install https://github.com/AlexxIT/HassWP/archive/master.zip
mkdir config
python -m hass_win -c config -v

I installed latest WinPython from here: https://sourceforge.net/projects/winpython/files/WinPython_3.10/3.10.9.0/Winpython64-3.10.9.0.exe/download

It runs fine
Everything installs fine,

when I run python -m pip install homeassistant==2023.5.3
(it does complain for some reason)

ERROR: pip's dependency resolver does not currently take into account all the pa
ckages that are installed. This behaviour is the source of the following depende
ncy conflicts.
great-expectations 0.14.11 requires cryptography<4.0.0,>=3.2, but you have crypt
ography 40.0.2 which is incompatible.

but after runing python -m pip install homeassistant==2023.5.3 again everything is fine

but when I try to run hss I get:

Traceback (most recent call last):
  File "L:\HomeAsistant Patch\WPy64-31090\python-3.10.9.amd64\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "L:\HomeAsistant Patch\WPy64-31090\python-3.10.9.amd64\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "L:\HomeAsistant Patch\WPy64-31090\python-3.10.9.amd64\lib\site-packages\hass_win\__main__.py", line 10, in <module>
    from homeassistant import __main__, const, setup
  File "L:\HomeAsistant Patch\WPy64-31090\python-3.10.9.amd64\lib\site-packages\homeassistant\setup.py", line 13, in <module>
    from . import config as conf_util, core, loader, requirements
  File "L:\HomeAsistant Patch\WPy64-31090\python-3.10.9.amd64\lib\site-packages\homeassistant\config.py", line 56, in <module>
    from .helpers import (
  File "L:\HomeAsistant Patch\WPy64-31090\python-3.10.9.amd64\lib\site-packages\homeassistant\helpers\config_validation.py", line 101, in <module>
    from . import script_variables as script_variables_helper, template as template_helper
  File "L:\HomeAsistant Patch\WPy64-31090\python-3.10.9.amd64\lib\site-packages\homeassistant\helpers\script_variables.py", line 9, in <module>
    from . import template
  File "L:\HomeAsistant Patch\WPy64-31090\python-3.10.9.amd64\lib\site-packages\homeassistant\helpers\template.py", line 44, in <module>
    from lru import LRU  # pylint: disable=no-name-in-module
ImportError: cannot import name 'LRU' from 'lru' (L:\HomeAsistant Patch\WPy64-31090\python-3.10.9.amd64\lib\site-packages\lru\__init__.py)

Not sure what the problem might be

Thanks for Anwsering and Best Regards

@AlexxIT AlexxIT added the question Further information is requested label Jun 23, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jun 23, 2023

I don't know what exact problem in your case. And I don't remember if I had something similar.
Maybe you have another python build. Maybe you don't have some developer environment in your system (Microsoft Visual Studio, etc.)
You can try to compare lru library from HassWP archive vs your version.

@AlexxIT AlexxIT closed this as completed Jun 23, 2023
@veso266
Copy link
Author

veso266 commented Jun 23, 2023

Well, the reason I wanted to build this myself is that I wanted to run hass on Windows 7 (since python310 usualy does not work there (if you are not creative))

I later discovered that if I just download your release, put the required dll inside portable python dir everything runs

So yea, if anyone wants to use this on windows 7, just download the release from here, add the missing dll and you are back in buisness 😄

@AlexxIT AlexxIT changed the title How do I pack a release if I do it myself? Support Windows 7 for latest Hass releases Jun 26, 2023
@AlexxIT AlexxIT reopened this Jun 26, 2023
@AlexxIT AlexxIT added enhancement New feature or request and removed question Further information is requested labels Jun 26, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jun 26, 2023

Wow. Nice info. I'll check it myself.

@Vitch612
Copy link

Vitch612 commented Aug 10, 2023

@veso266 thank you so much for sharing this. I just tested on windows 7x64 it and it works great. I will try to migrate my database and HA config from my current v2021.12.10 instance to this latest one. and comment back here if anything special is needed.
Turns out that database migration is not needed. simply pointing to the old db (even though there are structural changes) just works but generates a lot of errors in logs

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 5, 2024

@AlexxIT AlexxIT closed this as completed Jan 5, 2024
@AlexxIT AlexxIT pinned this issue Apr 20, 2024
@Vitch612
Copy link

Vitch612 commented Apr 29, 2024

v2023.12.4 - 2024-01-01 is the last release that can run on Windows 7. The reason is that the python hack to allow it to run on windows 7 only works until python 3.11, starting with 3.12 there is an additional requirement which prevents it from running.
The error says: The procedure entry point PssQuerySnapshot could not be located the dynamic link library KERNEL32.dll
Meaning unless a way is found to replace or patch KERNEL32.dll on windows 7 to contain the needed functions (might be more than one and not likely to happen as this seems to involve new functionality that is not present in older windows) or a way is found to run the latest HASS using python 3.11 (less unrealistic than patching kernel32 but also involves a substantial amount of work which is not likely to be undertaken to patch each new hass release and is ultimately pointless) there will be no more windows 7 support after version 2023.12.4

@veso266
Copy link
Author

veso266 commented Apr 29, 2024

Yea, after python 3.11 some people decided to get rid of windows 7 specific code: python/cpython@938e36f

that someone spent their hard and sould writing

Python 3.12 does work on windows 7 btw (good people are still fighting): https://github.com/adang1345/PythonWin7

Just need to find a way to make it (python) portable

@Vitch612
Copy link

@veso266 many thanks for sharing this windows 7 python initiative. I have downloaded their 3.12.3 embedded version and replaced in the latest hass (2024.4.3) the python executables and dlls with those from that embedded version and everything seems to be working fine (I did not do extensive testing) but my hass log is all green after adding a sonoflan integration with some devices. automations not tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants