Managing Python function dependencies
Cloud Functions can automatically install dependencies required for a Python function. To do this, when creating a new function version, Cloud Functions will run the pip install command in the project root (the directory with 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 this pip guide
Here is an example of the requirements.txt file:
boto3==1.13.15
attrs==19.3.0
The dependency installation process has some limitations. For more information, see Quotas and limits in Cloud Functions. You can view the dependency installation log via the link displayed in the list of operations.