

zip file archive that includes all of the installed libraries and source code by running the following command: zip -r. Then, copy and paste the following example code into the file and save it in your Lambda function's project directory: import numpy as npĭf2 = pd.DataFrame(np.array(,, ]),columns=)ĥ.

In a text editor, create a new file named lambda_function.py. If you're using macOS, then run the following command: cd my-lambda-functionĤ. Open your Lambda function's project directory. Important: Replace my-lambda-function with the name of your function's project directory. whl file as a dependency in your Lambda function's project directory by running the following command: Install the precompiled Python package's. If you're using a version of pip that's older than pip version 19.3.0, then upgrade to the latest version of pip by running the following command: python3.9 -m pip install -upgrade pipĢ. Then, confirm that you're using a version of pip that's version 19.3.0 or newer by running the following pip command: pip -version Note: This example procedure shows how to install pandas for the Lambda Python 3.9 runtime that's running on x86_64 architecture.ġ. For example: The win_amd64 and macosx_10_6_intel tags won't install a deployment package that's compatible with Lambda. To create a Lambda deployment package or layer that's compatible with Lambda Python runtimes when using pip outside of Linux operating system, run the pip install command with manylinux2014 as the value for the -platform parameter. This makes your deployment package incompatible with Lambda if you're not using a Linux operating system. If you install these packages using pip, then the packages download and compile a module-name package for the architecture of the local machine. Python packages that contain compiled code (for example: NumPy and pandas) aren't always compatible with Lambda runtimes by default.
