# ---- one-time environment setup for this course ----
# Run this from a terminal first:
#   pip install numpy matplotlib scikit-learn tensorflow
#
# (If you prefer PyTorch for the CNN/RNN lectures instead of TensorFlow/Keras,
#  "pip install torch" works too -- either framework is fine for this course.)

import importlib

REQUIRED = ["numpy", "matplotlib", "sklearn", "tensorflow"]

def check(pkg):
    try:
        mod = importlib.import_module(pkg)
        version = getattr(mod, "__version__", "unknown version")
        print(f"  [OK]   {pkg:<12} {version}")
        return True
    except ImportError:
        print(f"  [MISSING] {pkg:<12} -- run: pip install {pkg}")
        return False

print("Checking your Deep Neural Networks course environment...\n")
ok = all(check(pkg) for pkg in REQUIRED)

print("\nAll set -- you're ready for Lecture 2." if ok
      else "\nInstall the missing packages above, then re-run this script.")
