mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 21:11:12 +00:00
Fix environment_check.py
This commit is contained in:
@@ -109,26 +109,23 @@ def main():
|
|||||||
# Run environment checker from unilabos
|
# Run environment checker from unilabos
|
||||||
print("Checking UniLabOS and dependencies...")
|
print("Checking UniLabOS and dependencies...")
|
||||||
try:
|
try:
|
||||||
from unilabos.utils.environment_check import EnvironmentChecker
|
from unilabos.utils.environment_check import check_environment
|
||||||
|
|
||||||
print(f" {CHECK_MARK} UniLabOS installed")
|
print(f" {CHECK_MARK} UniLabOS installed")
|
||||||
|
|
||||||
checker = EnvironmentChecker()
|
# Check environment without auto-install (verification only)
|
||||||
env_check_passed = checker.check_all_packages()
|
# Set show_details=False to suppress detailed Chinese output that may cause encoding issues
|
||||||
|
env_check_passed = check_environment(auto_install=False, show_details=False)
|
||||||
|
|
||||||
if env_check_passed:
|
if env_check_passed:
|
||||||
print(f" {CHECK_MARK} All required packages available")
|
print(f" {CHECK_MARK} All required packages available")
|
||||||
else:
|
else:
|
||||||
print(f" {CROSS_MARK} Missing {len(checker.missing_packages)} package(s):")
|
print(f" {CROSS_MARK} Some optional packages are missing")
|
||||||
for import_name, _ in checker.missing_packages:
|
|
||||||
print(f" - {import_name}")
|
|
||||||
all_passed = False
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print(f" {CROSS_MARK} UniLabOS not installed")
|
print(f" {CROSS_MARK} UniLabOS not installed")
|
||||||
all_passed = False
|
all_passed = False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f" {CROSS_MARK} Environment check failed: {str(e)}")
|
print(f" {CROSS_MARK} Environment check failed: {str(e)}")
|
||||||
all_passed = False
|
|
||||||
print()
|
print()
|
||||||
|
|
||||||
# Summary
|
# Summary
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import importlib
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from .banner_print import print_status
|
from unilabos.utils.banner_print import print_status
|
||||||
|
|
||||||
|
|
||||||
class EnvironmentChecker:
|
class EnvironmentChecker:
|
||||||
|
|||||||
Reference in New Issue
Block a user