spark: verify Python environment availability
This commit is contained in:
1 parent
a7bcf29539
commit
9aba6df0a6
1 file changed
+29
@@ -0,0 +1,29 @@
|
||||
#!/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)
|
||||
Reference in new issue
Block a user