Skip to content

Commit 5e56ef5

Browse files
author
Steve Beaumont
authored
Update python-package.md
I spent many hours tracking down why my Python modules were not importable. When I renamed the package folder in the console from A to B and back from B to A the issue resolved and this led me to the discovery that files and directories must be globally readable for the Lambda to run despite everything looking perfectly OK in the console. I think it is important to fix this flaw or let people know about it.
1 parent 381eb29 commit 5e56ef5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc_source/python-package.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ To create or update a function with the Lambda API, create a deployment package
6262
}
6363
```
6464

65+
**Note**
66+
In order for your Python modules can be imported at runtime, ensure the files in the zip produced are globally readable (o+r) and any directories are globally readable (o+x).
67+
6568
## Updating a function with additional dependencies<a name="python-package-dependencies"></a>
6669

6770
If your Lambda function depends on libraries other than the AWS SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\.
@@ -204,4 +207,4 @@ A library may appear in `site-packages` or `dist-packages` and the first folder
204207
"RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f",
205208
...
206209
}
207-
```
210+
```

0 commit comments

Comments
 (0)