"[red]EPICPy requires Python 3.10 on Linux and MacOS, but that version of Python could not be located on this system. You can install Python 3.10 by running this command: uv python install 3.10[/red]"
)
sys.exit(1)
defget_python_3_9_path():
"""Get the path to Python 3.9 by checking for it explicitly."""
"[red]EPICPy requires Python 3. on Windows, but that version of Python could not be located on this system. You can install Python 3.9 by running this command: uv python install 3.9[/red]"
)
sys.exit(1)
defmain():
ensure_git_installed()
# Determine the appropriate Python version
ifplatform.system().lower()=="windows":
python_path=get_python_3_9_path()
else:
python_path=get_python_3_10_path()
# Step 1: Check if EPICpy is installed and uninstall it if necessary
uv_tool_list=run_command(["uv","tool","list"])
ifuv_tool_listand"EPICpy"inuv_tool_list:
console.print("[yellow]EPICpy is already installed. Uninstalling...[/yellow]")
run_command(["uv","tool","uninstall","EPICpy"])
# Step 2: Install EPICpy using the determined Python path
console.print(f"[cyan]Installing EPICpy with Python at {python_path}...[/cyan]")