gee-community/geemap

error with 'geemap.requireJS'

Dushuai12138 opened this issue · 5 comments

Environment Information

image

Description

error with 'geemap.requireJS'

What I Did

import geemap
WS = geemap.requireJS('users/dushuai/showANDdownload_rec_of_rgb:learningCode_from_articles/whittaker_smoother')
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\geemap\common.py:13482, in requireJS(lib_path, Map)
  13481 try:
> 13482     from oeel import oeel
  13483 except ImportError:

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\oeel\oeel.py:17
     16 from . import external
---> 17 from . import colab
     18 oeelLibPath=os.path.dirname(__file__)

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\oeel\colab.py:3
      2 import IPython
----> 3 from google.colab import output
      4 from google.oauth2.credentials import Credentials

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\google\colab\__init__.py:23
     22 from google.colab import _shell_customizations
---> 23 from google.colab import _system_commands
     24 from google.colab import _tensorflow_magics

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\google\colab\_system_commands.py:24
     23 import os
---> 24 import pty
     25 import select

File E:\ProgramData\Anaconda3\envs\gee1\Lib\pty.py:12
     11 import sys
---> 12 import tty
     14 # names imported directly for test mocking purposes

File E:\ProgramData\Anaconda3\envs\gee1\Lib\tty.py:5
      3 # Author: Steen Lumholt.
----> 5 from termios import *
      7 __all__ = ["setraw", "setcbreak"]

ModuleNotFoundError: No module named 'termios'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
Cell In[7], line 2
      1 import geemap
----> 2 WS = geemap.requireJS('users/dushuai/showANDdownload_rec_of_rgb:learningCode_from_articles/whittaker_smoother')

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\geemap\common.py:13484, in requireJS(lib_path, Map)
  13482     from oeel import oeel
  13483 except ImportError:
> 13484     raise ImportError(
  13485         "oeel is required for requireJS. Please install it using 'pip install oeel'."
  13486     )
  13488 ee_initialize()
  13490 if lib_path is None:

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

I have installed oeel - 0.9.8.6, the error still exists.

Try import oeel without using geemap. If it does not work, it is an oeel issue. Please report it to the oeel repo.

Try import oeel without using geemap. If it does not work, it is an oeel issue. Please report it to the oeel repo.

thanks a lot. I try to use import oeel and it does not give any error. However, I use from oeel import oeel and it outputs the same error message. So I try to rewrite from oeel import oeel to import oeel in geemap\common.py:13482 .After that, I run code WS = geemap.requireJS('users/dushuai/showANDdownload_rec_of_rgb:learningCode_from_articles/whittaker_smoother') and it outputs messages :

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[3], line 1
----> 1 js = geemap.requireJS('users/dushuai/showANDdownload_rec_of_rgb:learningCode_from_articles/whittaker_smoother')

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\geemap\common.py:13498, in requireJS(lib_path, Map)
  13495 if lib_path.startswith("http"):
  13496     lib_path = get_direct_url(lib_path)
> 13498 lib_path = change_require(lib_path)
  13500 if Map is not None:
  13501     oeel.setMap(Map)

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\geemap\common.py:13558, in change_require(lib_path)
  13555         os.system(cmd)
  13557 if not os.path.exists(lib_path):
> 13558     raise ValueError(f"{lib_path} does not exist.")
  13560 output = []
  13561 with open(lib_path, "r") as f:

ValueError: showANDdownload_rec_of_rgb:learningCode_from_articles/whittaker_smoother does not exist.

I also change the path from other researchers and the error exists. I couldn't tell if it was oeel's bug or geemap's bug.

If from oeel import oeel does not work, then it is an oeel issue. You can't simply change it to import oeel

Get it, thanks a lot!