← Back to Index

Fix Google APIs (Gmail, Drive, Calendar) - Permanent Solution

Problem

Python scripts for Gmail/Drive/Calendar fail with ModuleNotFoundError: No module named 'google'

Container is missing Google API libraries.

Root Cause

Docker image doesn't include Python Google API dependencies.

Permanent Fix (Run on Host)

cd /path/to/openclaw/repo

export OPENCLAW_DOCKER_APT_PACKAGES="python3-pip python3-venv python3-google-auth python3-googleapi python3-google-auth-httplib2 python3-google-auth-oauthlib ffmpeg"

./docker-setup.sh

This will:

  1. Rebuild the OpenClaw image with Google API libs baked in
  2. Restart the gateway
  3. All Python Google integrations work permanently

What This Fixes

Why This Approach

After Fix

Test with:

docker compose exec openclaw-gateway python3 -c "import google.oauth2.credentials; print('✅ Google libs available')"

Then search Drive for case color meeting notes:

docker compose exec openclaw-gateway python3 /home/node/.openclaw/workspace/tools/gdrive-search.py "case color" --after 2025-07-01 --before 2025-12-31

Status: Ready to execute
Time to fix: ~5 min (rebuild + restart)
Refactoring cost if we skip this: Hours of debugging every time container restarts