-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
In the creating a package for function with dependencies (ref), the command series to create the package do not work
Steps to reproduce
Following the same steps as the current docs
pip install --target ./package requests
zip -r my-deployment-package.zip ./package/
Produce a zip file with the "package" folder containing the dependencies
unzip -l my-deployment-package.zip
Archive: my-deployment-package.zip
Length Date Time Name
--------- ---------- ----- ----
0 2020-12-30 08:06 package/
0 2020-12-30 08:06 package/chardet/
...
4 2020-12-30 08:06 package/requests-2.25.1.dist-info/INSTALLER
2330 2020-12-30 08:06 package/requests-2.25.1.dist-info/RECORD
10142 2020-12-30 08:06 package/requests-2.25.1.dist-info/LICENSE
0 2020-12-30 08:06 package/idna-2.10.dist-info/
9104 2020-12-30 08:06 package/idna-2.10.dist-info/METADATA
110 2020-12-30 08:06 package/idna-2.10.dist-info/WHEEL
5 2020-12-30 08:06 package/idna-2.10.dist-info/top_level.txt
4 2020-12-30 08:06 package/idna-2.10.dist-info/INSTALLER
1565 2020-12-30 08:06 package/idna-2.10.dist-info/LICENSE.rst
1212 2020-12-30 08:06 package/idna-2.10.dist-info/RECORD
--------- -------
3753712 273 files
Therefore the following python module lambda_function.py
is unable to do import requests
once loaded to lambda.
import requests
def lambda_handler(event, context):
print("Test")
Testing produces
[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'requests'
Fix
Metadata
Metadata
Assignees
Labels
No labels