-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_setup.py
More file actions
114 lines (93 loc) · 3.04 KB
/
Copy pathverify_setup.py
File metadata and controls
114 lines (93 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env python3
"""
Verification script for MLflow tutorial setup.
Run this to verify that everything is correctly installed and configured.
"""
import sys
import importlib
def print_header(text):
"""Print formatted header."""
print("\n" + "=" * 70)
print(f" {text}")
print("=" * 70)
def check_import(module_name, display_name=None):
"""Check if a module can be imported."""
if display_name is None:
display_name = module_name
try:
mod = importlib.import_module(module_name)
version = getattr(mod, '__version__', 'unknown')
print(f"✓ {display_name:<20} version: {version}")
return True
except ImportError as e:
print(f"✗ {display_name:<20} NOT FOUND")
return False
def check_file_exists(filename):
"""Check if a file exists."""
import os
exists = os.path.exists(filename)
status = "✓" if exists else "✗"
print(f"{status} {filename}")
return exists
def main():
"""Main verification function."""
print_header("MLflow Tutorial - Environment Verification")
print("\nPython Version:")
print(f" Python {sys.version}")
# Check required packages
print_header("Checking Required Packages")
required_packages = [
('mlflow', 'MLflow'),
('numpy', 'NumPy'),
('pandas', 'Pandas'),
('sklearn', 'scikit-learn'),
('matplotlib', 'Matplotlib'),
('seaborn', 'Seaborn'),
('torch', 'PyTorch'),
]
all_installed = True
for package, display_name in required_packages:
if not check_import(package, display_name):
all_installed = False
# Check tutorial files
print_header("Checking Tutorial Files")
tutorial_files = [
'1_tracking.py',
'2_projects.py',
'3_models.py',
'4_model_registry.py',
'run_all.py',
'utils.py',
'MLproject',
'requirements.txt',
'README.md',
'QUICKSTART.md',
]
all_files_exist = True
for filename in tutorial_files:
if not check_file_exists(filename):
all_files_exist = False
# Final status
print_header("Verification Summary")
if all_installed and all_files_exist:
print("✓ All checks passed!")
print("\nYou're ready to run the tutorial:")
print(" python run_all.py")
print("\nOr run individual components:")
print(" python 1_tracking.py")
print(" python 2_projects.py")
print(" python 3_models.py")
print(" python 4_model_registry.py")
print("\nDon't forget to start MLflow UI in a separate terminal:")
print(" mlflow ui")
return 0
else:
print("✗ Some checks failed!")
if not all_installed:
print("\nMissing packages. Install them with:")
print(" pip install -r requirements.txt")
if not all_files_exist:
print("\nSome tutorial files are missing.")
return 1
if __name__ == "__main__":
sys.exit(main())