-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_installation.py
More file actions
49 lines (43 loc) · 1.22 KB
/
check_installation.py
File metadata and controls
49 lines (43 loc) · 1.22 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
"""Check if required packages are installed"""
import sys
print(f"Python version: {sys.version}")
print("-" * 60)
packages = [
'numpy',
'pandas',
'sklearn',
'xgboost',
'lightgbm',
'joblib',
'matplotlib',
'seaborn',
'plotly'
]
missing = []
installed = []
for package in packages:
try:
if package == 'sklearn':
import sklearn
print(f"✓ scikit-learn {sklearn.__version__}")
installed.append('scikit-learn')
else:
module = __import__(package)
version = getattr(module, '__version__', 'unknown')
print(f"✓ {package} {version}")
installed.append(package)
except ImportError:
print(f"✗ {package} NOT INSTALLED")
missing.append(package)
except Exception as e:
print(f"✗ {package} ERROR: {str(e)}")
missing.append(package)
print("-" * 60)
print(f"\nInstalled: {len(installed)} packages")
print(f"Missing: {len(missing)} packages")
if missing:
print("\nTo install missing packages, run:")
print(f"pip install {' '.join(missing)}")
else:
print("\n✓ All required packages are installed!")
print("\nYou can now run: python src\\train_models.py")