ultralytics 8.3.63 IMX500 sudo install fix (#18714)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Francesco Mattioli 2025-01-17 12:48:49 +01:00 committed by GitHub
parent 309f5cafc1
commit f777b63c8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 5 deletions

View file

@ -782,6 +782,18 @@ def cuda_is_available() -> bool:
return cuda_device_count() > 0
def is_sudo_available() -> bool:
"""
Check if the sudo command is available in the environment.
Returns:
bool: True if the sudo command is available, False otherwise.
"""
if WINDOWS:
return False
return subprocess.run(["sudo", "--version"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0
# Run checks and define constants
check_python("3.8", hard=False, verbose=True) # check python version
check_torchvision() # check torch-torchvision compatibility