Stay organized with collections Save and categorize content based on your preferences.
Dependencies for python applications are declared in a standard requirements.txt
file. For example:
Flask==MAJOR.MINOR.PATCH
google-cloud-storage
Replace MAJOR, MINOR, and PATCH with the desired Flask version numbers.
You can use any Linux-compatible Python package in the App Engine flexible environment, including packages that require native (C) extensions.
The Python runtime will automatically install all dependencies declared in your requirements.txt
during deployment.
When developing and testing your application locally, we recommended you use venv
to isolate your application's dependencies from your system packages. This also ensures that your dependencies will be the same version on your local machine and the deployed application.
To use venv
to install dependencies, complete the following steps:
python3 -m venv env
source env/bin/activate
hello_world
sample code. Then install dependencies:
cd YOUR_SAMPLE_CODE_DIR
pip install -r requirements.txt
Use PowerShell to run your Python packages.
python -m venv env
.\env\Scripts\activate
hello_world
sample code. Then, install dependencies:
cd YOUR_SAMPLE_CODE_DIR
pip install -r requirements.txt
This ensures that when you run your app locally, only the dependencies that are declared in the requirements.txt
file are available. The dependencies installed by App Engine during deployment are based on the contents of the requirements.txt
file, not the contents of the env/
directory.
pip freeze
to write the name and version of all installed packages to your requirements.txt
. Installing a web framework
You'll need to use a web framework to enable your app to serve web requests. You can use any Python web framework including the following:
To use a particular web framework, just add it to your requirements.txt
:
Flask==MAJOR.MINOR.PATCH
Installing a WSGI server
Some web frameworks have built-in WSGI servers; however, few of them are suitable for serving production traffic. Most web applications use a standalone WSGI server such as Gunicorn, uWSGI or Waitress. For more information on installing, configuring, and using a WSGI server see application startup.
Installing the Cloud Client LibrariesThe Cloud Client Libraries for Python is a client library for accessing Google Cloud services that significantly reduces the boilerplate code you have to write. The library provides high-level API abstractions so they're easier to understand. It embraces idioms of Python, works well with the standard Python library, and integrates better with your codebase.
For example, you can install the corresponding Python client library for Datastore or Cloud Storage to integrate those services with your app.
To install the Python client library for Cloud Datastore:
Install the client library locally by using pip
:
pip install google-cloud-datastore
Set up authentication. You can configure the Cloud Client Libraries for Python to handle authentication automatically. The client library can automatically handle authentication for you locally as well by using the Google Cloud CLI.
gcloud auth login
Use the Datastore Client Libraries reference to implement support for the Cloud Datastore service in your app.
For a complete list of all of the Cloud Client Libraries for Python for the supported Google Cloud services, see APIs & Python Libraries.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["Python application dependencies are declared in a `requirements.txt` file, which is used during deployment to automatically install the specified packages."],["It is recommended to use `venv` for local development to isolate application dependencies and ensure consistency between local and deployed environments."],["Any Linux-compatible Python package, including those with native extensions, can be used in the App Engine flexible environment."],["Web frameworks like Flask, Django, and Pyramid, can be integrated into applications by adding them to the `requirements.txt` file."],["Cloud Client Libraries, such as those for Datastore and Cloud Storage, can be easily installed using `pip` and configured for automatic authentication via the Google Cloud CLI."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4