================================================================================ GMAIL CLEANUP - CHALLENGE 2 SOLUTION Chapter 1: Configuration & API Setup Challenge: Install Dependencies ================================================================================ PROBLEM: Install and verify Python dependencies: 1. pip install -r requirements.txt 2. Create a test script that imports all libraries 3. Print library versions to verify installation SOLUTION: ================================================================================ STEP 1: Install Dependencies ================================================================================ pip install -r requirements.txt Expected output: Successfully installed google-auth-1.x.x google-auth-httplib2-0.2.0 google-auth-oauthlib-1.1.0 google-api-python-client-2.100.0 python-dotenv-1.0.0 STEP 2: Create test_imports.py ================================================================================ File: test_imports.py import sys print("=" * 60) print("TESTING GMAIL API DEPENDENCIES") print("=" * 60) try: import google.auth print(f"✅ google-auth: {google.auth.__version__}") except ImportError as e: print(f"❌ google-auth: {e}") sys.exit(1) try: import google_auth_oauthlib print("✅ google-auth-oauthlib: installed") except ImportError as e: print(f"❌ google-auth-oauthlib: {e}") sys.exit(1) try: import google_auth_httplib2 print("✅ google-auth-httplib2: installed") except ImportError as e: print(f"❌ google-auth-httplib2: {e}") sys.exit(1) try: import googleapiclient print(f"✅ google-api-python-client: {googleapiclient.__version__}") except ImportError as e: print(f"❌ google-api-python-client: {e}") sys.exit(1) try: import dotenv print("✅ python-dotenv: installed") except ImportError as e: print(f"❌ python-dotenv: {e}") sys.exit(1) print("\n" + "=" * 60) print("✅ ALL DEPENDENCIES INSTALLED SUCCESSFULLY!") print("=" * 60) STEP 3: Run the Test ================================================================================ python test_imports.py Expected output: ============================================================ TESTING GMAIL API DEPENDENCIES ============================================================ ✅ google-auth: 2.x.x ✅ google-auth-oauthlib: installed ✅ google-auth-httplib2: installed ✅ google-api-python-client: 2.100.0 ✅ python-dotenv: installed ============================================================ ✅ ALL DEPENDENCIES INSTALLED SUCCESSFULLY! ============================================================ TROUBLESHOOTING ================================================================================ If pip install fails: - Make sure you're in gmail-cleanup/ directory - Make sure Python 3.7+ is installed (python --version) - Try: pip install --upgrade pip If import fails: - Some libraries take time to fully install (restart terminal) - Check you installed in correct virtual environment - Try: pip list | grep google (verify installations) ================================================================================