Python installation

Overview

The Earth Engine Python API is a client library that facilitates interacting with the Earth Engine servers using the Python programming language. To use the Earth Engine Python API, at a minimum you will need to install the Earth Engine Python API client library and its dependencies. However, to facilitate developing algorithms, it is also useful to have access to a wide range of additional libraries and tools for managing code and visualizing results.

Creating a Python Development Environment

Deploying a Python Development Environment

When collaborating (including getting help) it is very useful for others to be able to easily replicate your development environment so that they can replicate the behavior that you are experiencing. In order to faciliate this, the following instructions describe how to create replicatable development environments for the Earth Engine Python API, using Docker software containers.

The development environment includes:
Option 1:
Running a Datalab Docker container on Google Cloud Platform

In this approach, the Earth Engine Python API runs in a Docker container on Google Cloud Platform and your local machine connects to the container via SSH. You access the container using your local browser.

Advantages
  • No need to install any software on your local machine.
  • Allows flexibility in choosing the size of computational resources.
  • Datalab will backup your notebooks on a regular schedule.
Disadvantages
  • Using Google Cloud Platform resources may cause you to incur charges.
Option 2:
Running a Docker container on a local computer

In this approach, the Earth Engine Python API runs in a Docker container on your local machine. You access the container using your local web browser.

Advantages
  • Avoids incurring GCP costs associated with running a server.
  • Allows you to interact with notebooks while offline (although requests to Earth Engine require an internet connection).
Disadvantages
  • Older OS versions may not support running Docker
  • Local hardware may not provide adequate resources for complex analyses

Where to go next

Now that you have installed and verified the Python API is working, the next step is to get familiar with Datalab/Jupyter/IPython. Start by navigating to and opening the following notebook:

[HOME] / datalab / docs / Readme.ipynb

Once you have a good understanding of how Jupyter notebooks work, you can learn about how to access Earth Engine by working through notebooks in the following folder:

[HOME] / datalab / docs-earthengine / 

When you are ready to create your own content, do so by creating folders and notebooks in the following folder:

[HOME] / datalab / notebooks / 

Minimal Installation for the Earth Engine Python API

Minimal Earth Engine Python API Installation
Installing the Earth Engine Python library

This set of instructions guides you in a minimal install of the Earth Engine Python API, without any additional tools.

Advantages
  • Starting with a minimal install provides you with flexibility in customizing your Python environement.
Disadvantages
  • A higher level of technical skill may be required to successfully create a working environment.
  • Given the differences between operatoring systems, Python installation methods and library versions, it may be difficult for others to reproduce your environment, which limits collaboration opportunities and may make getting support more difficult.

Send feedback about...

Google Earth Engine API