-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
2024.10.0 HA core doesn't find uv #127359
Comments
Same Problem here |
I get the same error after an upgrade to 2024.10.0 2024-10-02 21:39:41.233 ERROR (MainThread) [homeassistant.bootstrap] Error setting up integration frontend - received exception
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/setup.py", line 185, in async_setup_component
await future
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/setup.py", line 185, in async_setup_component
await future
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/setup.py", line 165, in async_setup_component
result = await _async_setup_component(hass, domain, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/setup.py", line 326, in _async_setup_component
await async_process_deps_reqs(hass, config, integration)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/setup.py", line 575, in async_process_deps_reqs
await requirements.async_get_integration_with_requirements(
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/requirements.py", line 54, in async_get_integration_with_requirements
return await manager.async_get_integration_with_requirements(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/requirements.py", line 170, in async_get_integration_with_requirements
await future
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/requirements.py", line 159, in async_get_integration_with_requirements
await self._async_process_integration(integration, done)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/requirements.py", line 182, in _async_process_integration
await self.async_process_requirements(
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/requirements.py", line 269, in async_process_requirements
await self._async_process_requirements(name, missing)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/requirements.py", line 301, in _async_process_requirements
installed, failures = await self.hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/requirements.py", line 115, in _install_requirements_if_missing
if pkg_util.is_installed(req) or _install_with_retry(req, kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/requirements.py", line 103, in _install_with_retry
if pkg_util.install_package(requirement, **kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/util/package.py", line 140, in install_package
with Popen(
^^^^^^
File "/usr/local/lib/python3.12/subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/lib/python3.12/subprocess.py", line 1955, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'uv' "uv" is installed from the dependency. A Downgrade to 2024.9.3 solve the problem. |
If you use systemd, add the path to the environment.
|
And also same problem for me (FileNotFoundError: [Errno 2] No such file or directory: 'uv') when upgrading from 2024.9.3 -> 2024.10.0 |
Thx, now home assistant frontend starts |
yeah that indeed fixed it for me too. Thanks! |
Thanks. The frontend start. |
After installing
|
Eventually, this worked for me. It was unclear to me which
|
Hi, |
@svenf01 You should not have the issue with HASSIO as uv will be available in the container. Please get the logs and create a new issue, and your one is different from the reported one here. |
Uv will be installed automatically during the installation of the home assistant. |
How do you run HA? Please provide all the information, which is requested in the issue description, too. Otherwise it's hard to help you |
Beware in my case isn't enough to pass only the bin PATH, I also need to create a environment with executing 'uv venv' in shell. @billyburly Same error logs I got, try to create the env. |
Running home assistant with systemd is a not supported installation type, and therefore, we will not give support for it. @terminet85 You did not provide how you are running HA, but all installation types we offered on www.home-assistant.io either use the container provided by us or you need to create a venv. So I'm expecting you are also using a not supported installation type |
@edenhaus sorry I tagged you wrongly. Yes, I'm using a unsupported installation. |
Worked for me. You can also add this to systmd to move log files to /var/log (where they should be)
Full text:
|
Adding the path to the environment worked for me too, thanks. |
Same problem for me. I upgraded to 2024.10.0 and it now keeps rebooting at random or not responding. Rolling back to previous version. |
If you are running HA from a pyenv you can actually get around creating another uv venv (because having a venv inside a venc is a bit silly and redundant) by including |
how to install Uv manually, please? |
Same issue. While I understand people with Core only on Python virtual are """""not supported""""", none of this helps someone not a Python expert. Whole installation hosed, many things do not load, TVs are useless now, my gate is out of commission (broadliink) and many other things. Not to mention all my PADs in the home and all remote access ceases to work. Us poor "unsupported" people who do not understand the above descriptions and what to do are in trouble and probably leaving. Downgraded to 2024.9.2 ... back to working. Set up a separate "test" installation and all is broken on it. So I will continue this way I guess, no way to upgrade without clear instructions on why "uv" directory is missing. |
the fix is in:
|
does not works. downgraded to 2024.10.0 and it works. But i have UV installed: /var/homeassistant/bin/uv and have the So, we, "non supported" core installations folks would gladly know how to make it work.... |
Without logs, no one here is going to be able to help. We don't even know if you have the same issue as OP. If |
So, log says:
if uv is present at /var/homeasssistant/bin/uv, how does i not works? |
Hello HASS community! Whilst adding a PATH is the systemd file seems to solve most issues, we found out in #127621 that this does not prevent some version mismatch that could end up blocking in the future. For contexte, the XIAOMI-BLE was not updated from 0.30.2 to 0.32.0 during the upgrade, even after:
I found out a quick fix that requires to upgrade manually the integration via pip: Still this might be the beginning of big issues if releases come up with lot of integration update. Edit : I reviewed my pip list versus the requirements_all.txt for 2024.10.1. As suspected, other updates failed silently. For instance, zeroconf is expected to be 0.135.0. pip list reports 0.133.0. Manual upgrade via pip works. |
At first you should check if theese envs are present for your hass process
|
I can't understand your experience. I have updated from version 2024.9.3 to 2024.10.0 without the PATH variable. Only after the frontend stopped working did I add the PATH variable in the systemd file. I just checked if zeroconf has the version 0.135. |
under which user? su to homeassistant user - sudo -u homeassistant -H -s ? |
Doesn't matter. You will see envs of existing process |
Thanks, this resolved the XIAOMI-BLE issue for me (manually upgrading via PIP). Bluesound integration also stopped working in 24.10.1 and your theory was correct there as well, upgraded Blupy via PIP and voila, issue solved. Pyblu updated from v 0.4 to 1.0.3 which suggests that it hasn't been touched for a while / wasn't automatically updated with home assistant. |
After looking back at a backup of my installation I'm starting to wonder : could it be uv using wrong Python version? Hence downloading the latest version of the integration compatible with that unexpected Python? Edit : Trying to install homeassistant using uv in that venv downloads 2024.3.3, or the latest release compatible with Python 3.11! We're on something I guess. I'll consider a feedback on the documentation for core to perform install and update from uv if your experience is similar to mine. |
If the venv is activated,
|
Same issue here with a HomeAssistant core installation, |
Same issue on Gentoo but with openrc and homeassistant installed via venv. Following the thread
|
Hi all, I had similar issues and I discovered that I had been reusing the same virtual environment every time I was upgrading HA Core. Lack of understanding, today was a school day. |
Yes, you should definitely do this every time you change Python versions. This is not specific to HA, but a general best practice. In fact, don't clear out the directory – completely remove the parent to ensure you also remove any hidden files and directories. As always, backup your instance.
Interesting. In my case, there was no Python change, as I've already been running Python 3.12 for a while. It would be good to know if others experienced the same. Maybe I'll try this out too. |
I upgrade my Python version in my venv before updating HA with Currently, I'm on 3.12 but I started probably around 3.8 or 3.9.
This should be a reasonable workflow as well - and less destructive. |
For me, this was not updating |
I absolutely appreciate your hard work on HomeAssistant. But in fact to break something in this way is kinda ridiculous. Especially without further notice. So for my Setup I fixed now the PATH, but in fact then HA is complaining about Python 3.9.x, which was not used for the venv. So actually I really would like to understand what you have changed and why. Especially since my setup worked now for years without any issues. HA expected a new python, i compiled it, created a new venv, installed HA again and everything worked as expected. Also starting a service via systemd is nowadays absolutely common. This is not rocket science and expected behavior on a systemd installation! Some help from your side would be highly appreciated! |
Chill. What gives you the impression this was deliberate or even a known issue? This is not the place to attack or rant. Provide additional technical information if you have any. Currently, this looks to be more of a problem with how virtual environments are managed by Python tooling. |
@parautenbach I do chill. I don't attack anyone nor I am about to rant. What I just don't like is the the attitude, that something is not supported. I mean for real, systemd is nowadays standard. And it's really not rocket science to configure a service with it. Especially since this ran for all of us for years without any issues. So of course I am interested what have been changed to cause this. For me it seems I fixed mostly of it. Or well... lets see till the next update. Steps:
Notes: I have several python versions installed (system wise and self compiled). If the PATH was not correctly declared, then sometimes it tried to use a completely wrong one, which resulted in issues. For instance integration home connect was not possible to install. Saw in the logs it tried to use python 3.9.7 |
I agree that this should be the focus for now. I'd like to avoid it, since it was quite a surprise. |
Updating the systemd file as per this post worked for me, indeed you MUST mention the python virtual env folder used to run HA:
where
|
Thank you, I solved with yo
Thank you very much. By(t)e |
For those who are on MacOS with HA Core and have problems with uv “not found” : I had a ~/Library/LaunchAgents/org.homeassistant.plist. |
Hya, i did try to update today, and have the following /etc/systemd/system/home-assistant.service: `[Unit] [Service] [Install] by cat /proc/$(pidof -x hass)/environ | tr
and get the following errors; `2024-10-20 11:01:32.317 INFO (SyncWorker_4) [homeassistant.util.package] Attempting install of aioesphomeapi==27.0.0 To install Python packages system-wide, try apt install If you wish to install a non-Debian-packaged Python package, If you wish to install a non-Debian packaged Python application, See /usr/share/doc/python3.12/README.venv for more information. Consider creating a virtual environment with To install Python packages system-wide, try apt install If you wish to install a non-Debian-packaged Python package, If you wish to install a non-Debian packaged Python application, See /usr/share/doc/python3.12/README.venv for more information. Consider creating a virtual environment with Advises, please? |
In my case, I'm using FreeBSD. What I needed to do was source the venv created by uv. I had been using the installation guide from here, but it stopped working after 2024.10. These are the steps to upgrade this setup.
|
I upgraded from 2024.09.03 to 2024.10.04 and in order to make it run, I changed my
That way, my Also, I find pretty surprising the HA core installation with systemd is not supported. Maybe it was how the phrase was written, but then how should I run HA core in a way that is supported ? https://www.home-assistant.io/installation/linux#install-home-assistant-core |
Pretty much nothing except the HA OS is supported and you'll get a rather aggressive message every time you ask. Remember: This is no longer an "open source" project but a "product with open source code and a company behind it trying to monetize it". |
FWIW, installing home-assistant with pipx used to work great until 2024.9.3. I just updated to 2024.10.4 and found this same problem with uv. |
My Home Assistant Core setup is on Ubuntu 22.04.5 LTS. After updating from 2024.9.3 to 2024.10.3, I started receiving a lot of errors. It appears that something went wrong with the virtual environment, specifically with the Python symlink files located at /srv/homeassistant/bin that pointed to the wrong location (python -> /usr/bin/python3) ll /srv/homeassistant/bin/python*
lrwxrwxrwx 1 homeassistant homeassistant python -> python3.12*
lrwxrwxrwx 1 homeassistant homeassistant python3 -> python3.12*
lrwxrwxrwx 1 homeassistant homeassistant python3.12 -> /usr/bin/python3.12* I updated the symlinks using the following commands: sudo ln -sf python3.12 /srv/homeassistant/bin/python
sudo ln -sf python3.12 /srv/homeassistant/bin/python3
sudo chown -h homeassistant:homeassistant /srv/homeassistant/bin/python
sudo chown -h homeassistant:homeassistant /srv/homeassistant/bin/python3 After updating the symlinks, the errors stopped. My original installation was as follows: sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.12 python3.12-dev python3.12-venv
sudo apt-get install -y bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff6 libturbojpeg0-dev tzdata ffmpeg liblapack3 liblapack-dev libatlas-base-dev
#setup new user:
sudo useradd -rm homeassistant
sudo chsh -s /bin/bash homeassistant
sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3.12 -m venv .
source bin/activate
python3.12 -m pip install wheel
pip3.12 install homeassistant My systemd looks like this: [Unit] [Service] [Install] |
For my pyenv setup, I got it working by setting the Service section in hass@ha.service like this: [Service] |
If you use the docker image and use homeassistant-docker-venv, you need this commit: tribut/homeassistant-docker-venv@5ffd91e as stated in tribut/homeassistant-docker-venv#38. |
The problem
After upgrade from previous verison got LOTS of errors like this
Main page returns 404: Not Found
uv component is installed
pip3 install uv Requirement already satisfied: uv in /opt/homeassistant/lib/python3.12/site-packages (0.4.15)
What version of Home Assistant Core has the issue?
2024.10.0
What was the last working version of Home Assistant Core?
2024.9.3
What type of installation are you running?
Home Assistant Core
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: