Open ksahbaz opened 1 year ago
Tested with 3.34.1 - the plugin seems to work fine. I'm not 100% sure, but this error may indicate that you may have conflicting Python libraries in your PATH and/or PYTHONPATH. Please make sure you don't have any so that the QGIS Python environment won't get any conflicts.
I have the same issue. I checked my PATH in the QGIS Python console with
import os print(os.environ)
There are only QGIS paths in the output. Any idea how to fix it?
Thanks fir reporting, investigating, trying to reproduce the problem. Maybe it's time to upgrade the EE library.
Did you just install the plugin or did it simply stop working?
For me the plugin was working fine until recently. Now I am getting the same error. I'm using miniforge with a couple of environments simultaneously, but I haven't change anything in the QGIS Environment
@wwf-simon, what version of the QGIS and plugin do you have installed?
@gena I'm using QGIS 3.32.1 and GEE Plugin 0.0.6
Does anyone figured the solution of this ?
QGIS version 3.36.0-Maidenhead
QGIS code revision [09951dc0acf](https://github.com/qgis/QGIS/commit/09951dc0acf)
Installed version [0.0.6](file:///home/arky/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin)
``
@arky, @wwf-simon, the main root cause of this problem is probably the conflict between Python versions. If there are other versions of Python installed on your machine, they may conflict with the QGIS Python. Can you check what you see then you run the following commands in QGIS Python console?
import sys
'\n'.join(sys.path)
Thanks @gena I do have the multiple python versions. Any way to force qgis to use system default python or python3 would be great.
print("\n".join(sys.path))
/usr/share/qgis/python
/home/arky/.local/share/QGIS/QGIS3/profiles/default/python
/home/arky/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python310.zip
/usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/home/arky/.local/lib/python3.10/site-packages
/usr/local/lib/python3.10/dist-packages
/usr/lib/python3/dist-packages
/home/arky/.local/share/QGIS/QGIS3/profiles/default/python
.
/home/arky/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux
/home/arky/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing
/home/arky/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing/ext_libs
Hmm, it looks good, the first path is from the QGIS as well. Let me make a pre-release with the new version of Earth Engine and see if this will help. The version used in the plugin is 0.1.335 and the latest one is 0.1.395.
I've also tested it with the QGIS 3.36.1 and everything works fine at least on Windows.
Can you uninstall the plugin and then install it from a zip file listed at the end of this page: https://github.com/gee-community/qgis-earthengine-plugin/actions/runs/8405368583 ?
Can you uninstall the plugin and then install it from a zip file listed at the end of this page: https://github.com/gee-community/qgis-earthengine-plugin/actions/runs/8405368583 ?
Installed the new ubuntu artifact and have same data error and warning about circular dependency. So I think there might be something odd happening on my machine.
Thanks, we've excluded at least one reason for the error here :-).
Are you able to call the EE from your main Python environment? Like do you have the earthengine-api package installed and can you run the earthengine authenticate
command? And then also try to pip uninstall earthengine-api there to see if this is where the conflict comes from.
The plugin libs dirs are actually added at the end when the plugin is initialized, maybe adding them earlier will fix things (we can try this next).
'earthengine' binary is shipped with 'earthengine-api' pip package. I have authenticated, set project name and saved the creditionals to default location.
Then tested the following in a python repl:
$ python
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ee
>>> ee.Initialize()
>>> print(ee.String('Hello,World').getInfo())
Hello,World
Removing the earthengine-api package and then running 'import ee' in Qgis python console has the same error.
Hi @arky @ksahbaz @wwf-simon @rainerwrainer
I found the issue, the problem is due to new changes in the GEE python API in the latest version, it conflicts with our custom EE import wrapper. I refactored the process of importing EE lib and the authentication method to avoid this.
Could you please do a test using the ee_plugin.zip
inside the zip package by OS that you can download here in the artifacts: https://github.com/gee-community/qgis-earthengine-plugin/actions/runs/8452162046
With these changes, it requires ee.Initialize()
in your scripts
@XavierCLL works for me! thank you
@XavierCLL Thank you for the fix.
The current "8452162046" ubuntu artifact works perfectly on Qgis 3.36.1-Maidenhead | QGIS code revision | 3e589453264
Bug resolved for me.
Hi, the GitHub action for packaging has an issue fixed in a PR, so the artifact that I mentioned needs to be fixed (meanwhile my two PRs are merging), the easiest method is to open the zip, change the directory name "extlibs_linux" to "extlibs_windows" or "extlibs_darwin", zip it again and install it (Linux is not affected)
Hi all, I have an issue with EE Plugin as message below:
Traceback (most recent call last):
File "C:\PROGRA~1\QGIS33~1.0\apps\Python39\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
Could you please help me to investigate and how can I fix it?
Could you please help me to investigate and how can I fix it?
@Souvansaysb Could you try with the latest version of the plugin from here? It fixed the issue for me : https://github.com/gee-community/qgis-earthengine-plugin/actions/runs/8452162046
@arky : I have tred, but I still get an error right here:
An error has occurred while executing Python code:
AttributeError: partially initialized module 'ee' has no attribute 'data' (most likely due to a circular import) Traceback (most recent call last): File "C:\Users/rsmek/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\ee_plugin.py", line 125, in updateLayers import ee File "C:\Users/rsmek/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin__init.py", line 38, in wrapping_ee_import module = builtin_import__(name, *args, **kwargs) File "C:\PROGRA~1/QGIS33~1.0/apps/qgis/./python\qgis\utils.py", line 923, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users\rsmek\AppData\Roaming\Python\Python39\site-packages\ee__init.py", line 15, in from ee import _utils File "C:\Users/rsmek/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\init.py", line 40, in wrapping_ee_import__ if not module.data._credentials: AttributeError: partially initialized module 'ee' has no attribute 'data' (most likely due to a circular import)
Python version: 3.9.18 (heads/master:5eba59e, Feb 1 2024, 20:02:10) [MSC v.1929 64 bit (AMD64)] QGIS version: 3.36.0-Maidenhead Maidenhead, 09951dc0
@Souvansaysb based on that code error you are not using the version that fix that, as @arky mentioned, first download this https://github.com/gee-community/qgis-earthengine-plugin/issues/133#issuecomment-2022726154 then to this https://github.com/gee-community/qgis-earthengine-plugin/issues/133#issuecomment-2041273663
@XavierCLL Thank you very much, Now my Qgis is working as normal. There are a few steps that I followed:
@Souvansaysb sorry for the tricks to have a functional plugin, we are going to release a new version with the fixes as soon as we can.
I am currently working on a time sensitive project, and I need help resolving an error from using the Python console on QGIS. I have QGIS version QGIS version 3.34.4-Prizren on my linux Ubuntu 22.04.4 LTS, Codename-Jammy. Then I successfully installed earthengine-api via my terminal, which was followed by proper authentication using earthengine authenticate.
Then I searched for Earth Engine Plugin on QGIS and I installed it. When I tried to import ee, I got the following errors below:
`Python Console
import ee
Traceback (most recent call last):
File "/usr/lib/python3.10/code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
In addition, I read the thread provided here https://github.com/gee-community/qgis-earthengine-plugin/issues/133,but I could not reach a solution. I also tried the following code: export PYTHONPATH=/usr/bin/qgis/share/qgis/python
and export LD_LIBRARY_PATH=/usr/bin/qgis/lib
, but no hope. I still got the same error in when I tried to import ee in QGIS.
I would be glad for possible solutions to resolve this error. Thanks
Hi @TaiwoGabriel, have you read this discussion thread? That error has been resolved here, follow this https://github.com/gee-community/qgis-earthengine-plugin/issues/133#issuecomment-2044517610 (and when you download that zip, decompress it and the zip inside is what you install in Qgis) the PR is still waiting to merge....
Thank you @XavierCLL. Your solution resolved my problem. I am really grateful. Take care.
Hi @XavierCLL, sorry to bother you again. I encountered an error when I tested the ee_plugin with a short code. I was able to import ee successfully. Also, from ee_plugin import Map was successful. However, when I typed the following code: countries = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017"), I got the error below:
Traceback (most recent call last):
File "/usr/lib/python3.10/code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in ee.Initialize()
I authenticated the earth engine client library using earthengine authenticate
via my ubuntu terminal. I also switched to the python interface on terminal and then typed
import ee ee.Authenticate()- authentication successful ee.Initialize()
These three codes were executed successfully, but I still got the error above on my QGIS/Python Console when I tried this code again: countries = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017").
Please, can you provide any suggestion or help?
the error is clear, include ee.Initialize()
in your script after import ee
(that is part of the second PR)
It worked. Thanks once again.
Thanks. It worked, but I got this error when I executed this code:
import ee ee.Initialize() from ee_plugin import Map countries = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017") country = countries.filter(ee.Filter.eq('country_na', 'Ukraine')) Map.addLayer(country, { 'color': 'orange' }, 'feature collection layer')
AttributeError: 'QgsRasterDataProvider' object has no attribute 'set_ee_object'. Although, the shapefile layer for Ukraine executes successfully,. What could be the reason for the error?
please open a new issue because that is not related to this one and does not generate noise here, thanks!
Alright. Thank you.
@XavierCLL
The artifacts expired. Can you post them again?
Hi @mariochermes, here it is the zip with the latest fixes, after install/update it, restart Qgis
Thanks @XavierCLL!
I've already installed the plugin and I get similar errors in two cases as follows:
ee
in QGIS Python Console.import ee
works on jupyter and python in command prompt seamlessly.QGIS: Version: 3.34.0-Prizren Code revision: ffbdd67881
Plugin: Installed version: 0.0.6