gee-community / qgis-earthengine-plugin

Integrates Google Earth Engine and QGIS using Python API
http://qgis-ee-plugin.appspot.com
MIT License
448 stars 115 forks source link

Error: Not signed up for Earth Engine or project is not registered #143

Open colemanjj opened 6 months ago

colemanjj commented 6 months ago

After installing the qgis-earthengine-plugin I registered for the Google Earth Engine through the web interface and created a new project. That all worked fine. But in QGIS, in the python console I got the error: "Not signed up for Earth Engine or project is not registered" repeatedly if I did the following commands:

import ee print(ee.String('Hello World from EE!').getInfo()) or import ee ee.Initialize() or if I tried to use the other plugins like "Google earth Engine Data Catalog"

However the problem was solved if I entered the following commands in the Python console:

ee.Initialize(project='my-project-name')

I'm not sure if this is a problem with my installation (Windows 10, Qgis 36.1, python 3.9) or something else but I spent 6-8 hours trying to figure this out. You might want to mention this solution in your documentation.

XavierCLL commented 6 months ago

@colemanjj

Yes, we are aware of that, initialize EE in a project will be mandatory in the near future but not now, and we are going to update some docs. But, I can run ee.Initialize() without a problem. It is weird that you have that issue right now. @colemanjj thanks for reporting it.

Info related:

jdbcode commented 6 months ago

If you run earthengine set_project my-project in your command prompt, it should add the given project as a default to the credentials file that is created and stored during the authentication step in plugin setup. If a project is added to the credentials file, you should not have to set the project when calling ee.Initialize(), unless you want to run the compute through a different project than the default you set.

Your credentials file is stored here (in case you want to inspect):

XavierCLL commented 6 months ago

Thanks so much for the info @jdbcode! Do you know when it is mandatory to link the project in GEE credentials or in ee.Initialize()?

jdbcode commented 5 months ago

@XavierCLL we're encouraging everyone to use cloud projects now, if they can. A person can continue to not use a cloud project if they are authenticating with either the localhost or gcloud-legacy modes (https://developers.google.com/earth-engine/guides/auth#quick_reference_guide_and_table). As EE becomes more integrated into Google Cloud, it becomes increasingly difficult to support legacy (non-cloud) usage.

XavierCLL commented 5 months ago

@XavierCLL we're encouraging everyone to use cloud projects now, if they can. A person can continue to not use a cloud project if they are authenticating with either the localhost or gcloud-legacy modes (https://developers.google.com/earth-engine/guides/auth#quick_reference_guide_and_table). As EE becomes more integrated into Google Cloud, it becomes increasingly difficult to support legacy (non-cloud) usage.

Thanks so much Justin for the information!

PietroCiccale commented 1 month ago

Hi, since this issue is still opened I'm going to write this here. I tried everything in order to get GEE into QGIS, but it really became frustrating. All I did, I tried in two accounts with different projects. I registered my projects in google cloud and activated the GEE API. I installed the gcloud, I tried to set my project and my credentials manually within the prompt, I tried uninstall and reinstall QGIS and GEE plugin many times. I always get the error "Not signed up for Earth Engine or project is not registered", no matter the project nor account. the ee.Initialize(project='my-project') also does not work since the error falls on the first row for the python plugin in QGIS(Figure 1): import ee. In command prompt everything looks fine (Figure 2). Any clues? Figure 1 image Figure 2 image

XavierCLL commented 1 month ago

Hi @PietroCiccale

The complete integration of using GEE project in the plugin is still a work in progress, but for now you can use this https://github.com/gee-community/qgis-earthengine-plugin/issues/133#issuecomment-2248775157 update to initialize the project as you show in the figure 2, let me know if with that works for you.

PietroCiccale commented 1 month ago

Hi @PietroCiccale

The complete integration of using GEE project in the plugin is still a work in progress, but for now you can use this #133 (comment) update to initialize the project as you show in the figure 2, let me know if with that works for you.

This finally worked, thank you so much Xavier!