-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify_requirements.py
More file actions
38 lines (32 loc) · 1.15 KB
/
verify_requirements.py
File metadata and controls
38 lines (32 loc) · 1.15 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
import sys
print("🔍 Verifying Python environment...\n")
print(f"📦 Python path: {sys.executable}")
print(f"🐍 Python version: {sys.version}\n")
# Optional: Import from separate check_airflow script
try:
import check_airflow
except ImportError:
print("❌ Failed to import Airflow verification module.")
except Exception as e:
print(f"⚠️ Error running Airflow check: {e}")
# Helper to print result of each import
def check_import(pkg_name, import_name=None, version_attr="__version__"):
try:
module = __import__(import_name or pkg_name)
version = getattr(module, version_attr, "Version not found")
print(f"✅ {pkg_name} version: {version}")
except ImportError:
print(f"❌ {pkg_name} is NOT installed.")
except Exception as e:
print(f"⚠️ Error checking {pkg_name}: {e}")
# Other packages to verify
packages = [
("DBT", "dbt"),
("Pymongo", "pymongo"),
("Finnhub", "finnhub"),
("Dotenv", "dotenv", "__file__"), # Special case: show file path
("Snowflake Connector", "snowflake.connector"),
]
for pkg in packages:
check_import(*pkg)
print("\n✅ All checks complete.")