1. "ModuleNotFoundError: No module named 'google'"
The Cause: You likely skipped the environment setup or installed packages globally but ran inside a venv (or vice versa).
The Fix: Force install the package again in your current terminal:
pip install --upgrade google-genai
2. API Key Errors (403 / 401)
The Cause: The client cannot authenticate with the closed-source backend.
Checklist:
- Did you actually create a key in Google AI Studio?
- Did you enable billing if your current Gemini image route requires it? Free-tier availability and limits can change over time.
- Availability: Check Google's current regional and account availability. Do not attempt to bypass service restrictions.
Setting a Proxy in Python
If you are getting connection timeouts:
import os
# Set this BEFORE importing google.genai
os.environ["http_proxy"] = "http://127.0.0.1:7890"
os.environ["https_proxy"] = "http://127.0.0.1:7890"
from google import genai
3. "RuntimeError: CUDA out of memory"
The Cause: Wait, why are you seeing this? Nano Banana 2 Client DOES NOT use CUDA!
💡 Short on 24GB VRAM for Offline Models?
If you're running an open-weight model, match the rental to that model's official GPU count and VRAM. HunyuanImage 3.0, for example, is documented as a multi-GPU-class deployment—not a universal one-A100 setup.
Read the Cloud Deployment Sandbox Guide →If you see this, you are likely trying to run an offline model such as Hunyuan 3.0,
Qwen-Image, Z-Image, SDXL, or FLUX on your own GPU. As mentioned in our hardware guide, these
local routes have model- and implementation-specific requirements. If your hardware is limited, use the nano_api.py cloud client or follow the evidence-first cloud planning guide above.