29 lines
621 B
Python
29 lines
621 B
Python
#!/usr/bin/env python3
|
|
"""Verify Python is available and working."""
|
|
|
|
import sys
|
|
import shutil
|
|
|
|
# Check Python version
|
|
version = sys.version_info
|
|
print(f"Python {version.major}.{version.minor}.{version.micro}")
|
|
|
|
# Verify key modules
|
|
try:
|
|
import json
|
|
import os
|
|
print("Core modules: OK")
|
|
except ImportError as e:
|
|
print(f"ERROR: Missing module {e}")
|
|
sys.exit(1)
|
|
|
|
# Check python executable location
|
|
python_path = shutil.which('python3')
|
|
if python_path:
|
|
print(f"Executable: {python_path}")
|
|
else:
|
|
print("ERROR: python3 not in PATH")
|
|
sys.exit(1)
|
|
|
|
print("Python environment: VERIFIED")
|
|
sys.exit(0) |