From c1a719d14148a4bc0a5c38607010349a1692db9b Mon Sep 17 00:00:00 2001 From: zdy023 Date: Wed, 1 May 2024 21:40:35 +0800 Subject: [PATCH] ver May1st a temporary workround for Mac hosts. --- desktop_env/envs/__init__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/desktop_env/envs/__init__.py b/desktop_env/envs/__init__.py index 065ff3e..133812e 100644 --- a/desktop_env/envs/__init__.py +++ b/desktop_env/envs/__init__.py @@ -7,6 +7,9 @@ import threading import uuid import zipfile from time import sleep +import logging + +logger = logging.getLogger("desktopenv.envinit") import psutil import requests @@ -190,10 +193,12 @@ def _install_virtual_machine(vm_name, working_dir="./vm_data", downloaded_file_n def __download_and_unzip_vm(): # Determine the platform and CPU architecture to decide the correct VM image to download if platform.system() == 'Darwin': # macOS - if os.uname().machine == 'arm64': # Apple Silicon - url = UBUNTU_ARM_URL - else: - url = UBUNTU_X86_URL + #if os.uname().machine == 'arm64': # Apple Silicon + #url = UBUNTU_ARM_URL + #else: + #url = UBUNTU_X86_URL + url = UBUNTU_ARM_URL # a workout as most new macs are using apple silicon and they are frequently misrecognized as x86_64 + logger.warning("Your platform is temporarily considered to be ARM. If this is a mistake, please manually replace the downloaded VM under ./vm_data with the VM of x86 version from %s", UBUNTU_X86_URL) elif platform.machine().lower() in ['amd64', 'x86_64']: url = UBUNTU_X86_URL else: