-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
AttributeError: partially initialized module 'ee' has no attribute 'data' (most likely due to a circular import) #133
Comments
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 There are only QGIS paths in the output. |
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. |
@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 ?
|
@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?
|
Thanks @gena I do have the multiple python versions. Any way to force qgis to use system default python or python3 would be great.
|
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 ? |
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 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:
Removing the earthengine-api package and then running 'import ee' in Qgis python console has the same error. |
…of EE is working perfectly for authentication process from Qgis console, also this fix a circular import bug #133
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 With these changes, it requires |
@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. |
…sults, otherwise not possible to test it because a bug #133
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, Traceback (most recent call last): |
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) Python version: 3.9.18 (heads/master:5eba59e, Feb 1 2024, 20:02:10) [MSC v.1929 64 bit (AMD64)] |
@Souvansaysb based on that code error you are not using the version that fix that, as @arky mentioned, first download this #133 (comment) then to this #133 (comment) |
@XavierCLL Thank you very much, Now my Qgis is working as normal.
|
@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 In addition, I read the thread provided here #133 I could not reach a solution. I also tried the following code: 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 #133 (comment) (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): I authenticated the earth engine client library using
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 |
It worked. Thanks once again. |
Thanks. It worked, but I got this error when I executed this code: import ee 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. |
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
The text was updated successfully, but these errors were encountered: