[Python] Allow pip3 packages to be imported on AWS Lambda

Add a layer for your package to your AWS Lambda layer.

  1. Create a folder with packages

    pip3 install -t python/lib/python3.7/site-packages <package name>
    

--Replace python3.7 as appropriate

  1. Zip the python folder into a zip
  2. Upload to layer
  3. Add a layer to the function for which you want to use the package
  4. Can be used with ʻimport `

reference

https://blog.ikedaosushi.com/entry/2018/12/22/231421

environment

macOS 10.15.4 Python 3.7.7

Recommended Posts

[Python] Allow pip3 packages to be imported on AWS Lambda
I want to AWS Lambda with Python on Mac!
Posted as an attachment to Slack on AWS Lambda (Python)
Run Python on Schedule on AWS Lambda
Things to note when running Python on EC2 from AWS Lambda
Install packages that need to be compiled with Python3 with pip [Windows]
[Python] Run Headless Chrome on AWS Lambda
Install python on xserver to use pip
Connect to s3 with AWS Lambda Python
Periodically run a python program on AWS Lambda
[AWS / Lambda] How to load Python external library
Summary of studying Python to use AWS Lambda
Summary of points I was addicted to running Selenium on AWS Lambda (python)
Check types_map when using mimetypes on AWS Lambda (Python)
How to set layer on Lambda using AWS SAM
Deploy Python3 function with Serverless Framework on AWS Lambda
Try running a Schedule to start and stop an instance on AWS Lambda (Python)
A little trick to know when writing a Twilio application using Python on AWS Lambda
[AWS] What to do when you want to pip with Lambda
[Python] Scraping in AWS Lambda
[AWS] Try adding Python library to Layer with SAM + Lambda (Python)
Update python on Mac to 3.7-> 3.8
Post images of Papillon regularly on Python + AWS Lambda + Slack
Building an environment to execute python programs on AWS EC2
How to use Python lambda
How to make AWS Lambda Layers when running selenium × chrome on AWS Lambda
xgboost (python) on EC2 Spot instance environment prepared by AWS Lambda
Best practice for logging in JSON format on AWS Lambda / Python
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
[For Python] Quickly create an upload file to AWS Lambda Layer
[Introduction to Udemy Python 3 + Application] 58. Lambda
Summary if using AWS Lambda (Python)
Install Python on Windows + pip + virtualenv
[Lambda] [Python] Post to Twitter from Lambda!
Write AWS Lambda function in Python
Notify HipChat with AWS Lambda (Python)
Steps to install python3 on mac
[Python] Make pip available on macOS
[AWS SAM] Introduction to Python version
Update Python on Mac from 2 to 3
Use AWS lambda to scrape the news and notify LINE of updates on a regular basis [python]
ImportError when trying to use gcloud package with AWS Lambda Python version
I tried with the top 100 PyPI packages> I tried to graph the packages installed on Python
Upload what you got in request to S3 with AWS Lambda Python
Notes on resolving references to packages in Python projects in IntelliJ IDEA (PyCharm)
[AWS] Using ini files with Lambda [Python]
Migrate Django applications running on Python 2.7 to Python 3.5
How to read pydoc on python interpreter
[Kivy] How to install Kivy on Windows [Python]
Install python library on Lambda using [/ tmp]
Python 3.9 dict merge (`|`) seems to be useful
Steps to install Python environment on Ubuntu
Regularly post to Twitter using AWS lambda!
How to erase Python 2.x on Mac.
Connecting from python to MySQL on CentOS 6.4
Memorandum on how to use gremlin python
scipy stumbles with pip install on python 2.7.8
I want to play with aws with python
How to install packages on Alpine Linux
How to access RDS from Lambda (python)
Lambda function to take AMI backup (python)