1

I am trying to run a simple program that I can use as a working example for the Google Earth Engine API, however I get the above error whenever I run it. Here is the code:

import ee
import ee.mapclient

image1 = ee.Image(1);
print(image1);

As you can see it is a very simple program I just want to get it to run so I can do more advanced tasks but I can't even get this simple one to work.

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
user3431573
  • 69
  • 1
  • 10

1 Answers1

1

You did not authenticate your application, hence the error.

Add:

ee.Initialize()

and you're good to go.

Lukasz Tracewski
  • 10,794
  • 3
  • 34
  • 53
  • This didn't seem to work. I added this line right after the first import statement and had no luck so I tried after the second and still nothing. I get the same error. Is there something I'm doing wrong? – user3431573 Feb 11 '16 at 02:37
  • 1
    @user3431573 Let's start from scratch then. Have you followed installation instructions https://developers.google.com/earth-engine/python_install ? How exactly are you running it? Be sure to do python -c "import ee; ee.Initialize()" - don't try do this from e.g. IPython / Jupyter Notebook. – Lukasz Tracewski Feb 13 '16 at 19:49
  • Any idea why `ee.Initialize()` produces error from Jupyter Notebook? @Lukasz Tracewski – MEhsan Apr 09 '17 at 17:32
  • 1
    Does it produce the error outside Jupyter? Is it 404? – Lukasz Tracewski Apr 09 '17 at 18:37
  • Yes, it actually used to give me `EEException` `404` error inside and outside Jupyter Notebook! And it terns out I have not signed up for Google Earth Engine-- in the first place! It is now woking inside Jupyter Notebook once I have signed up – MEhsan Apr 09 '17 at 19:18
  • Yes, signing up for the service helps a great deal :). It's an excellent compute engine - have fun! If you have just started, I'd recommend using the "Playground" of GEE instead of Jupyter. – Lukasz Tracewski Apr 09 '17 at 20:19