#any idea how to fix this? i think after
1 messages ยท Page 1 of 1 (latest)
Check your log file
There were many changes between 2023.2 and .7, so you may have been caught by a breaking change
(also, if it stopped at .7, make sure your venv uses Python 3.11)
apparently now after some 20min it does something, as it was waiting for something to finish
how could i ensure the venv uses py 3.11? tbh i try my best to understand things as a windows user, but linux is still unclear for me ๐
Any reason you're not using Docker then?
when i did, the container regularly went off, which didnt happen for core
Activate the venv and type
python --version
homeassistant@himbeerkuchen:/home/cornstar $ source /srv/homeassistant/bin/activate
(homeassistant) homeassistant@himbeerkuchen:/home/cornstar $ python --version
Python 3.10.7```
There you go
Time for a new venv
https://github.com/pyenv/pyenv-installer is your friend
(I need to update my venv upgrade guide to cover using that)
aye, will read myself into that - would that update stuff or would it just create a brand new venv?
thanks so far
New venv is the sane way
And pyenv makes that stupid simple
pyenv install 3.11.6 # Install Python 3.11.6
pyenv virtualenv 3.11.6 venv-3.11.6 # Create venv-3.11.6 using Python 3.11.6
https://blog.ceard.tech/2017/12/upgrading-python-virtual-environment#prepare-the-system has all the packages you may need to install first
hm, that process of installing the packages takes ages, still at 1% - no idea why...
but meanwhile
a) where shall i update the pyenv? as my normal user, on my homeassistant user or within the pyenv?
b) apparently i run python 2.7.18 as my normal user, while its 3.10.7 as the home assistant user - is that any error source?
after i installed all the packages, i did as you recommended:
Downloading Python-3.11.6.tar.xz...
-> https://www.python.org/ftp/python/3.11.6/Python-3.11.6.tar.xz
Installing Python-3.11.6...```
however, there is no update at all after some 15min again - is that intended?
Pi4 should be faster, but still tens of minutes
Sadly Pis are not very highly powered
Great educational tools, underwhelming servers
not used to linux at all - technically commanding a developer team as a PO in rl who work on linux all day, but i am only experienced with windows
alright, i now did the sto steps here
how would i now instruct HA to use that "instance"?
Create a new venv
Activate the new venv
install HA fresh (it'll use the same config folder)
Update the systemd unit file
[Unit]
Description=Home Assistant
After=network-online.target
[Service]
Type=simple
User=homeassistant
ExecStart=/data/homeassistant/.pyenv/versions/venv-3.11.4/bin/hass -c "/data/homeassistant/.homeassistant" --log-rotate-days 1
[Install]
WantedBy=multi-user.target
i think the new env was created by pyenv, right?
Yes
That's mine, where homeassistant's home is /data/homeassistant
(and Python 3.11.4)
so if i used
source /srv/homeassistant/bin/activate
it would run into the 3.10.7 one
Yes
how would i let it know i wanna use the venv-3.11.6?
pyenv activate venv-3.11.6
Honestly, unless you've a strong reason to stay on a pure Core setup, use Docker
i could consider using a new sd card for it soon-ish, but i dont have a spare one now and tbh i just need it running again
That may be easier than you expect
Another year, another Python deprecation, another flood of posts asking how to upgrade a Python venv.
Install Docker, point the container at your existing config folder, start the container
ok, that indeed sounds feasible - around a year ago i was frustrated as the HA container always went down for no reason, then decided for core
but things might be more stable now
The container going down is most likely a host problem, not a container problem
as HA is currently installing, let me ask you about the Update the systemd unit file please - what would that mean?
is that the service i created to autostart it?
Yes
You have to change the ExecStart entry
ExecStart=/data/homeassistant/.pyenv/versions/venv-3.11.4/bin/hass -c "/data/homeassistant/.homeassistant" --log-rotate-days 1
Yours would probably be
ExecStart=/home/homeassistant/.pyenv/versions/venv-3.11.6/bin/hass -c "/home/homeassistant/.homeassistant" --log-rotate-days 1
But you can check
also is there a need to disable the old implementation somewhere? guess as the service isnt running right now, just changing the systemd will do, right?
Stop the old one, update the unit file, reload, and then start it
aye
systemctl stop homeassistant
nano /etc/systemd/system/homeassistant.service
systemctl daemon-reload
systemctl start homeassistant
maybe a bit unrelated, but everytime i use apt-get, i get the following alert:
File "/usr/bin/apt-listchanges", line 29, in <module> import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'
i remember doing something back then to enable a more recent python version, bot i cant recall what it was
apparently searched wrong then - last question, i hope:
[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: python3.11 -m pip install --upgrade pip
shall i do that, or would it have any side effects?
Don't do it
the old systemd was
Description=Home Assistant
After=network-online.target
[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/%i/.homeassistant"
[Install]
WantedBy=multi-user.target```
You've created the new venv?
yea, venv-3.11.6
ls -al /home/homeassistant/.pyenv/versions/venv-3.11.6/bin/hass
-rwxr-xr-x 1 homeassistant homeassistant 279 Dec 5 22:38 /home/homeassistant/.pyenv/versions/venv-3.11.6/bin/hass
Yours would probably be
ExecStart=/home/homeassistant/.pyenv/versions/venv-3.11.6/bin/hass -c "/home/homeassistant/.homeassistant" --log-rotate-days 1
When I said that I was right ๐
๐ i cant really follow what this is doing tho - so we found out the path?
Yes
Edit you systemd unit
replace the ExecStart line
(optionally hard code the user as homeassistant)
[Unit]
Description=Home Assistant
After=network-online.target
[Service]
Type=simple
User=homeassistant
ExecStart=/home/homeassistant/.pyenv/versions/venv-3.11.6/bin/hass -c "/home/homeassistant/.homeassistant" --log-rotate-days 1
[Install]
WantedBy=multi-user.target
yep, did that, it gives me plenty of warnings for custom integrations like notered
dwd
hacs
dwains_dashboard
hass_agent
adaptive_lighting
xiaomi_cloud_map_extractor
nodered
anniversaries
var
browser_mod
can i ignore them?
[homeassistant.loader] We found a custom integration browser_mod which has not been tested by Home Assistant. This co>~
Yes, you can ignore
i think right now the integrations need to complete setup, which took ages on the previous version already
Yeah, every integration needs Python libraries. Those have to be downloaded, and some have to be compiled too
has the answer ๐