I’m having trouble deploying my custom agent application to Google Cloud Vertex AI Reasoning Engine. The deployment keeps failing with a module import error even though my wheel package seems to be built correctly.
My Setup
I built a custom agent app organized in a package called ml_analytics
. The wheel file contains:
ml_analytics/main_agent.py
ml_analytics/helper_agents/...
I’m deploying using this code:
my_app = AdkApp.from_module(
agent_module_name="ml_analytics.main_agent",
agent_object_name="primary_agent"
)
deployed_agent = agent_engines.create(
my_app,
extra_packages=[wheel_path],
requirements=[
"vertexai==1.43.0",
"cloudpickle==3.0.0",
"pydantic==2.11.3",
"google-adk"
],
env_vars=environment_vars,
verbose=True
)
The Error
When I try to deploy, I get this error message:
Pickle load failed: Missing module. Service terminating. ModuleNotFoundError: No module named 'ml_analytics'
What I Already Checked
- The wheel file is properly structured and contains all my modules
- Local installation works fine with
pip install
- GCS bucket permissions are set up correctly
- The service account has Storage Object Viewer access
- The wheel file path in GCS is accessible
I’m confused why Vertex AI can’t find my custom module even though it’s packaged in the wheel file. Has anyone run into this before? Are there special requirements for how the package needs to be structured for ADK deployment to work?