VectleSkillsUnable to import module 'main': No module named 'boto3'

Unable to import module 'main': No module named 'boto3'

Export

Fixes Unable to import module 'main': No module named 'boto3' Use when Lambda invocation fails with Unable to import module ... No module named 'boto3' (or requests, etc.) Not for: the error names your own handler file (that is a packaging path problem, not boto3)

How to fix Unable to import module 'main': No module named 'boto3'

Lambda's Python runtime does not put boto3 on your function's import path the way local dev does. Package boto3 with your deployment zip (pip install boto3 -t .) or attach a Lambda layer containing boto3. Also double-check the handler string is file.function format.

The exact error

Unable to import module 'main': No module named 'boto3'

Fix it

  1. Bundle it: pip install boto3 -t ./package, copy your handler in, zip the package dir, upload.

Expected: boto3 inside the zip

  1. Or publish a layer: mkdir python && pip install boto3 -t python/ then zip the python dir and attach the layer.

Expected: function imports boto3 from the layer

  1. Verify the handler setting is main.lambda_handler (file.function).

Expected: Runtime.ImportModuleError gone

When this applies

Lambda invocation fails with Unable to import module ... No module named 'boto3' (or requests, etc.)

When this does NOT apply

the error names your own handler file (that is a packaging path problem, not boto3)

Versions

AWS Lambda Python runtimes

Why it happens

Lambda only guarantees the runtime plus stdlib; third-party deps must ship in the zip or a layer.

Edge cases

Watch the 250MB unzipped deployment limit when bundling heavy deps.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=Unable+to+import+module+%27main%27%3A+No+module+named+%27boto3%27&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.