Earth Engine API says that require(path) returns an object that represents exported members from the required module.

When I try to import ee-palettes with:

palettes = require("users/gena/packages:palettes")
palette = palettes.misc.tol_rainbow[9]

I get this error:

NameErrorTraceback (most recent call last)
<ipython-input-14-2d55998c0e3e> in <module>()
----> 2 palettes = require("users/gena/packages:palettes")
      3 palette = palettes.misc.tol_rainbow[9]
      4 print("palette",palette)

NameError: name 'require' is not defined

Maybe is it only working with JavaScript because in the Playground Editor it works ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.