Install the Earth Engine API and geemap
Install the Earth Engine Python API and geemap. The geemap Python package is built on top of the ipyleaflet and folium packages, and implements several methods for interacting with Earth Engine data layers, such as Map.addLayer(), Map.setCenter(), and Map.centerObject(). The script below checks if the geemap package is installed. If not, it will install geemap, which automatically installs its dependencies, including earthengine-api, folium, and ipyleaflet.
Installs geemap package
import subprocess
try:
import geemap
except ImportError:
print('Installing geemap ...')
subprocess.check_call(