Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: gcloud command not found. Please ensure that gcloud is installed. #145

Closed
haoweiduan opened this issue Apr 6, 2024 · 11 comments
Closed

Comments

@haoweiduan
Copy link

After installing the gcloud SDK, I ran the following command and got a "ERROR: gcloud command not found. Please ensure that gcloud is installed."error.
import ee ee.Authenticate() service_account = '[email protected]' credentials = ee.ServiceAccountCredentials(service_account, './my-project-1111cceb213b.json') ee.Initialize(credentials)
When I comment out "ee.Authenticate()" and run print(ee.String('Hello World from EE!').getInfo()), I got "ee.ee_exception.EEException: Project 'projects/xxx' not found or deleted."
but the same code works in python geemap, I'm confused where the problem is.
(windows11 QGIS3.34.5 Python 3.9 Google Earth Engine 0.0.6)

@XavierCLL
Copy link
Collaborator

Hi @haoweiduan

This is a new requirement in the GEE API, you need to run ee.Initialize(project=my-project) with a project, check this related issue #143

@haoweiduan
Copy link
Author

Hi @haoweiduan

This is a new requirement in the GEE API, you need to run ee.Initialize(project=my-project) with a project, check this related issue #143
I have tried
ee.Authenticate() ee.Initialize(project='my-project')
but I got "ee.ee_exception.EEException: Not signed up for Earth Engine or project is not registered."

@XavierCLL
Copy link
Collaborator

have you created your 'my-project'? check the links and docs

@haoweiduan
Copy link
Author

When I executed the code, I replaced my project name with “my-project”
console shows "QGIS EE Plugin authenticated successfully". But then the following error message was displayed:
raceback (most recent call last):
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 326, in _execute_cloud_call
return call.execute(num_retries=num_retries)
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\googleapiclient_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\googleapiclient\http.py", line 938, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/algorithms?prettyPrint=false&alt=json returned "Not signed up for Earth Engine or project is not registered. Visit https://developers.google.com/earth-engine/guides/access". Details: "Not signed up for Earth Engine or project is not registered. Visit https://developers.google.com/earth-engine/guides/access">

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users/xxx/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin_init_.py", line 42, in wrapping_ee_import
module.Initialize(http_transport=httplib2.Http())
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee_init_.py", line 140, in Initialize
ApiFunction.initialize()
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\apifunction.py", line 154, in initialize
signatures = data.getAlgorithms()
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 1128, in getAlgorithms
return _cloud_api_utils.convert_algorithms(_execute_cloud_call(call))
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 328, in _execute_cloud_call
raise _translate_cloud_exception(e)
ee.ee_exception.EEException: Not signed up for Earth Engine or project is not registered. Visit https://developers.google.com/earth-engine/guides/access

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 326, in _execute_cloud_call
return call.execute(num_retries=num_retries)
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\googleapiclient_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "C:\Users\xxx\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\googleapiclient\http.py", line 938, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/algorithms?prettyPrint=false&alt=json returned "Not signed up for Earth Engine or project is not registered. Visit https://developers.google.com/earth-engine/guides/access". Details: "Not signed up for Earth Engine or project is not registered. Visit https://developers.google.com/earth-engine/guides/access">

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\QGIS\apps\Python39\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "", line 4, in
File "C:\Users/duanhaowei/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin_init_.py", line 46, in wrapping_ee_import
module.Initialize(http_transport=httplib2.Http())
File "C:\Users\duanhaowei\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee_init_.py", line 140, in Initialize
ApiFunction.initialize()
File "C:\Users\duanhaowei\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\apifunction.py", line 154, in initialize
signatures = data.getAlgorithms()
File "C:\Users\duanhaowei\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 1128, in getAlgorithms
return _cloud_api_utils.convert_algorithms(_execute_cloud_call(call))
File "C:\Users\duanhaowei\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows\ee\data.py", line 328, in _execute_cloud_call
raise _translate_cloud_exception(e)
ee.ee_exception.EEException: Not signed up for Earth Engine or project is not registered. Visit https://developers.google.com/earth-engine/guides/access

@XavierCLL
Copy link
Collaborator

I think I fixed it but we have not released it yet, please reinstall the plugin using the artifact described in #133 (comment)

Please let me know if that fixes your error

@haoweiduan
Copy link
Author

I think I fixed it but we have not released it yet, please reinstall the plugin using the artifact described in #133 (comment)

Please let me know if that fixes your error

I have reinstalled the plugin,when I import ee
a new error message was displayed :
Traceback(most recent call last): File "D:\QGIS\apps\Python39\lib\code.py", line 90, in runcode exec(code, self.locals) File "<input>", line 1, in <module> File "<string>", line 4, in <module> File "D:\QGIS/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ModuleNotFoundError: No module named 'ee'

@XavierCLL
Copy link
Collaborator

have you restarted Qgis after installing the plugin? (that is necessary)

@haoweiduan
Copy link
Author

have you restarted Qgis after installing the plugin? (that is necessary)

Of course, I tried to restart it three times.

@XavierCLL
Copy link
Collaborator

I found an error in the Artifacts zip, one second...

@XavierCLL
Copy link
Collaborator

@haoweiduan The solution is waiting in a PR, meanwhile the easiest method is open the zip, change the directory name "extlibs_linux" to "extlibs_windows", zip it again and install it

@haoweiduan
Copy link
Author

我想我修复了它,但我们还没有发布它,请使用 #133 中描述的工件重新安装插件 (评论)

如果这解决了您的错误,请告诉我

I have reinstall

@haoweiduan The solution is waiting in a PR, meanwhile the easiest method is open the zip, change the directory name "extlibs_linux" to "extlibs_windows", zip it again and install it

It works, that's cool. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants