You are downloading version 7.1 of Google Earth. This version automatically installs recommended updates. If you'd like previous versions of Google Earth or a version of 7.1 that does not update, please visit the Direct Installers page.
The Earth Engine Python client library is compatible with Python versions supported by Google Cloud. Support is updated annually following the Python point release schedule (PEP 602; Status of Python versions). Using unsupported Python versions may cause authentication failures, unexpected behavior, or failure of certain operations.
If you are using Google Colab, the latest version of the Earth Engine Python client library has already been installed (via pip). Try the following notebook to get started with Earth Engine and Colab:
This will select the best authentication mode for your environment, and prompt you to confirm access for your scripts. To initialize, you will need to provide a project that you own, or have permissions to use. This project will be used for running all Earth Engine operations:
Both the Python and JavaScript APIs access the same server-side functionality, but client-side expressions (learn more about client vs. server) can vary because of language syntax differences. The following table includes a list of the common syntax differences you'll encounter when working with the Python API relative to the JavaScript API.
Exporting data with the Python API requires the use of the ee.batch module, which provides an interface to the Export functions. Pass parameter arguments as you would with the JavaScript API, minding the differences noted in the syntax table above. Export tasks must be started by calling the start() method on a defined task. Query a task's status by calling the status() method on it. The following example demonstrates exporting an ee.Image object.
Printing an Earth Engine object in Python prints the serialized request for the object, not the object itself. Refer to the Client vs. server page to understand the reason for this. Call getInfo() on Earth Engine objects to get the desired object from the server to the client:
The Earth Engine ui module is only available through the JavaScript API Code Editor. Use third party libraries for UI elements in Python. Libraries such as geemap, Folium, and ipyleaflet provide interactive map display, while charting can be done with Matplotlib, Altair, or seaborn, to name a few. See examples in the Earth Engine in Colab setup notebook for using geemap and Matplotlib.
Python code is included throughout the Earth Engine Developer Guide. Where available, code examples can be viewed by clicking on the "Colab (Python)" tab at the top of code blocks. Guide pages may also include buttons at the top for running the page as a Colab notebook or viewing on GitHub. Python code examples are intended to be run using Google Colab. Interactive map and object exploration are handled by the geemap library. Both the Earth Engine Python client library and geemap are preinstalled in Colab.
Running Python code requires that you import the Earth Engine library, authenticate, and initialize. The following commands are used in examples (see the Authentication and Initialization page for alternatives).
The geemap library is used for displaying map tiles and printing rich representations of Earth Engine objects. The library depends respectively on ipyleaflet and eerepr for these features. The geemap library and its dependencies are preinstalled in Google Colab; import it into each session.
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.
This is also a simpler version of the method recommended by Ubuntu Community Help Wiki on GoogleEarth. (simpler because lsb_core, as all other dependencies, are automatically installed by Software Center)
There is also PPA for Google Earth, but for some reason there is no google-earth-stable, but google-earth-ec package. The ec is Enterprise Client. The difference is that it will ask (once) to which server to login, defaulting to public google server. And the icon is ugly yellow.
The Earth Engine JavaScript API is distributed as an npm package that is hosted on GitHub. The following instructions give an overview of installing the Google Earth Engine JavaScript API. To use the Earth Engine JavaScript API you'll need to install the client library and its dependencies on your computer and then set up authentication credentials.
The JavaScript client library does not include all functionality of the Earth Engine Code Editor. Notably, user interface features such as buttons, panels, and charts are excluded. Installing the client library 1. Set up Node.js and npm npm is a package manager for JavaScript and Node.js. Verify that you have Node.js 6+ and npm 3+.
Earth Engine APIs use the OAuth 2.0 protocol for authenticating browser-based clients. For server-side authentication in Node.js, service accounts are recommended. Web apps may use either approach, with pros and cons discussed below.
With client-side authentication in a web browser, users of your application log in with their own Google accounts. These users must already be authorized to access Earth Engine, and must have permission to read the assets used by your application.
With server-side authentication, a private key is stored with your application, allowing it to access the Earth Engine API through a service account. Users of your application do not need their own access to Earth Engine, and are not required to log in.
The Earth Engine Python API can be installed to a local machine viaconda, a Pythonpackage and environment manager. Conda is bundled withAnaconda andMinicondaPython distributions. Anaconda is a data science programming platformthat includes 1500+ packages, while Miniconda includes only conda and itsdependencies. Either of these Python distributions are suitable forinstalling and working with the Earth Engine API. If you're unfamiliarwith these distributions, please visit their links to learn more.
If conda is installed and its system path is registered in the PATHenvironmental variable, conda help contents should appear in theterminal. If the help contents appear, skip to theInstall API section. If conda is not recognized, theresult will read something like:conda not found or not recognized as a command. It is possible that theprogram exists on your system but is not registered in the PATHenvironmental variable. Even if this is the case, for consistency, pleasecontinue with the Install conda section, as it isdifficult to address all possible system configurations. As long as thefolder 'miniconda3' does not exist in your Home folder, the followingconda install instructions should succeed. For more information on condainstall location and registration, please see theMiniconda Installationand Anaconda Installationpages.
In this section you will download and install Miniconda, which will serveas the Python platform to access the Earth Engine API. Asdescribed above, you may use Miniconda or Anaconda, but tominimize impact to your system, this guide will describe aMiniconda installation with no alteration to your system'senvironmental variables. If you prefer Anaconda, please see theinstallation instructions providedhere and then skip to theInstall API section.
Complete these steps by copying and pasting the following lines into theappropriate command line interface for your system. Installationresults in a folder named 'miniconda3' added to your Home directory.
Print the conda command's help menu to test the Miniconda install.Since Miniconda has not been added to your system's PATH environmentvariable, you will first need to activate conda for this session bycalling the activate command by its full system path. A successful testwill result in conda help contents appearing in the terminal. Run thefollowing lines in your system's command line interface.
You can optionally add the Miniconda installation path to your system'sPATH variable, which will allow you to interact with conda bya simple call to conda without having to first run the activatecommand by its full path. The following instructions walk through addingthe Miniconda install to your system's PATH variable.
The Earth Engine Python API is distributed as a conda-forge package at: -forge/earthengine-api.It is installed with the conda install command. Before installing,however, make a conda environment specifically for Earth Engine.Installing the Earth Engine API to its own environment ensures that itand its dependent packages will not cause versioning issues with yourbase environment or any other environment you've previously set up andvice versa. For more information on managing conda environments, pleasevisit this site.
You will be asked to confirm the installation of the API and itsdependencies. After confirming, conda will download and install thedependencies. If all goes well, you will now have a conda environmentcalled 'ee' with all the requirements for accessing the API, as well asthe earthengine command line tool.
Before using the Earth Engine API or earthengine command line tool, youmust perform a one-time authentication that authorizes access to EarthEngine on behalf of your Google account. To authenticate, use theauthenticate command from the earthengine command line tool.
Within your conda ee environment run the following command and followthe resulting printed instructions. A URL will be provided that generatesan authorization code upon agreement. Copy the authorization code andenter it as command line input.
Upon entering the authorization code, an authorization token gets savedto a credentials file which can be found below. Subsequent use of theAPI's ee.Initialize() command and the earthengine command line toolwill look to this file to authenticate. If you want to revokeauthorization, simply delete the credentials file.
d3342ee215