From 3da0529fa1cf56c239cd2c24876db2de4c7812b2 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Mon, 23 Sep 2024 21:13:48 +0200 Subject: [PATCH] fallback to regular pip install if uv pip fails --- music_assistant/server/helpers/util.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/music_assistant/server/helpers/util.py b/music_assistant/server/helpers/util.py index 82c2f3dba..55c8439e8 100644 --- a/music_assistant/server/helpers/util.py +++ b/music_assistant/server/helpers/util.py @@ -44,6 +44,20 @@ async def install_package(package: str) -> None: args = ["uv", "pip", "install", "--no-cache", "--find-links", HA_WHEELS, package] return_code, output = await check_output(*args) + if return_code != 0 and "Permission denied" in output.decode(): + # try again with regular pip + # uv pip seems to have issues with permissions on docker installs + args = [ + "pip", + "install", + "--no-cache-dir", + "--no-input", + "--find-links", + HA_WHEELS, + package, + ] + return_code, output = await check_output(*args) + if return_code != 0: msg = f"Failed to install package {package}\n{output.decode()}" raise RuntimeError(msg)