gee-community/geemap

OEEL - Calling JavaScript functions from Python issue

johannepelletier opened this issue · 3 comments

Description

I am trying to use the OEEL package in jupyter lab, following the instruction the Geemap book, 3.9 Calling JavaScript functions from Python. I first installed node.js and git. After, I ran the %pip install oeel in the Anaconda prompt. In jupyter lab, I imported the package with import oeel.

What I Did

My problem happened when I tried to run
oeel = geemap.requireJS()
I tried run the %pip install oeel , and restarted the kernel.

I tested the following script:

oeel=geemap.requireJS()
as well as:
oeel=geemap.requireJS('users/OEEL/lib:loadAll')
My problem seems to be with geemap.requireJS()

Thank you very much in advance!

I am adding the traceback call below:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File ~\miniconda3\envs\gee\lib\site-packages\geemap\common.py:13213, in requireJS(lib_path, Map)
  13212 try:
> 13213     from oeel import oeel
  13214 except ImportError:

File ~\miniconda3\envs\gee\lib\site-packages\oeel\oeel.py:17
     16 from . import external
---> 17 from . import colab
     18 oeelLibPath=os.path.dirname(__file__)

File ~\miniconda3\envs\gee\lib\site-packages\oeel\colab.py:3
      2 import IPython
----> 3 from google.colab import output
      4 from google.oauth2.credentials import Credentials

ModuleNotFoundError: No module named 'google.colab'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_10476\2072491301.py in ?()
----> 1 oeel=geemap.requireJS()
      2 # oeel=geemap.requireJS('users/OEEL/lib:loadAll')

~\miniconda3\envs\gee\lib\site-packages\geemap\common.py in ?(lib_path, Map)
  13211     """
  13212     try:
  13213         from oeel import oeel
  13214     except ImportError:
> 13215         raise ImportError(
  13216             "oeel is required for requireJS. Please install it using 'pip install oeel'."
  13217         )
  13218 

ImportError: oeel is required for requireJS. Please install it using 'pip install oeel'.

Can your try running the following without geemap? If it does not work, then it is an oeel issue.

from oeel import oeel