rgee icon indicating copy to clipboard operation
rgee copied to clipboard

Error in loading rgee library

Open sob95 opened this issue 2 years ago • 2 comments

  • rgee version: 1.1.3
  • R version: 4.1.1
  • Operating System: Windows 10 64-bit

I have been happily using rgee with no problems up until yesterday. Today when I tried to load the library I got this error: library(rgee) Error: package or namespace load failed for ‘rgee’: .onLoad failed in loadNamespace() for 'rgee', details: call: py_module_import(module, convert = convert) error: ModuleNotFoundError: No module named 'ee' package ‘rgee’ was built under R version 4.1.3

I checked out my rgee environment in conda and everything looked good (earthengine-api is installed, etc..), so I reinstalled rgee and restarted my R session. Unfortunately, this did not solve the problem and I continue to get the error.

As a note: I updated the earthengine libraries in my conda environment yesterday. Things were working find after the update, so probably not that, but perhaps.

Is anybody else having trouble loading the library??

sob95 avatar May 06 '22 09:05 sob95

Hi,

Until recently, everything was working well but now calling library(rgee) brings this error:

Error: package or namespace load failed for ‘rgee’: .onLoad failed in loadNamespace() for 'rgee', details: call: py_module_import(module, convert = convert) error: ModuleNotFoundError: No module named 'ee'

I do not know how to proceed from here.

Kindly help

ArapKorir avatar May 27 '22 12:05 ArapKorir

Hi @ArapKorir sorry for my late reply,

I notice that in some systems if there is NULL pointers related to the EARTH ENGINE PYTHON API in the global environment, rgee return that error (see image below) when it is loaded.

image

Can you try to delete them before loading rgee?

csaybar avatar Jul 14 '22 18:07 csaybar

rgee version 1.1.5 R version 4.2.1 (2022-06-23 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 22621)

Hi, I'm having the same issue. rgee was working fine for days, and then all of a sudden I get this issue. I have removed and reinstalled, restarted R, etc. I have cleared the global environment and still getting the error. Can you help me? Thank you.

image

schignel avatar Oct 09 '22 21:10 schignel

Set a Python ENV that has ee ('earthengine-api') "Python" package installed.

library(reticulate)
use_python("/usr/bin/python3.8")
library(rgee)
...

csaybar avatar Oct 10 '22 00:10 csaybar

Thanks @csaybar, I have included the full code below. See the following error when running use_python(). Apologies, I'm pretty new to this...

image

schignel avatar Oct 11 '22 19:10 schignel

UPDATE: For others who encounter this, the fix for me was simple: Exit R Studio, open R Studio again, create a totally new project, and open the script in there.

schignel avatar Oct 11 '22 23:10 schignel

UPDATE: For others who encounter this, the fix for me was simple: Exit R Studio, open R Studio again, create a totally new project, and open the script in there.

It worked! Thank you!

chiarasalv23 avatar Oct 28 '22 08:10 chiarasalv23

has anyone found a solution that doesn't require creating a new project? It does work but it seems like there must be a better way

sam-a-levy avatar Feb 08 '23 17:02 sam-a-levy

Hi I have the same issue. Yesterday it worked perfectly fine and this morning I get this error:

library(rgee) Error: package or namespace load failed for ‘rgee’: .onLoad failed in loadNamespace() for 'rgee', details: call: NULL error: ModuleNotFoundError: No module named 'ee'

Has anyone found a solution? None of the previous solutions worked for me.

Regards

Jfgrass avatar Jun 07 '23 09:06 Jfgrass