Managing Python function dependencies
Cloud Functions can automatically install dependencies required for a Python function to run. To do this, when creating a new function version, Cloud Functions will run the pip install
command in the project root (folder containing the function).
To specify the required function libraries, list them in the requirements.txt
file. For more information about the requirements.txt
file format, see the pip documentation
Example of the requirements.txt
file:
boto3==1.13.15
attrs==19.3.0
The dependency installation process has some restrictions. For more information, see Quotas and limits in Cloud Functions. You can view the dependency installation log using the link that appears in the list of operations.