openforis / sepal

Geographical Data Processing in the Cloud
https://sepal.io/
MIT License
205 stars 46 forks source link

geemap import is failing #212

Closed dfguerrerom closed 2 years ago

dfguerrerom commented 2 years ago

Apparently, something changed in the last sepal build and now the import of geemap is failing. Are you @12rambau able to reproduce this error also?


KeyError                                  Traceback (most recent call last)
File /usr/local/lib/python3.8/dist-packages/geemap/basemaps.py:210, in <module>
    209 try:
--> 210     name = item["name"]
    211     basemap = "basemaps.{}".format(name)

KeyError: 'name'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
Input In [58], in <cell line: 1>()
----> 1 import geemap

File /usr/local/lib/python3.8/dist-packages/geemap/__init__.py:28, in <module>
     26     from .eefolium import *
     27 else:
---> 28     from .geemap import *

File /usr/local/lib/python3.8/dist-packages/geemap/geemap.py:17, in <module>
     15 from ipyleaflet import *
     16 from IPython.display import display
---> 17 from .basemaps import ee_basemaps
     18 from .common import *
     19 from .conversion import *

File /usr/local/lib/python3.8/dist-packages/geemap/basemaps.py:218, in <module>
    216 basemap = "basemaps.{}".format(name)
    217 basemap = basemap.replace("Mids", "Modis")
--> 218 ee_basemaps[name] = basemap_to_tiles(eval(basemap))

File ~/.local/lib/python3.8/site-packages/ipyleaflet/leaflet.py:54, in basemap_to_tiles(basemap, day, **kwargs)
     41 """Turn a basemap into a TileLayer object.
     42 
     43 Parameters
   (...)
     51     Extra key-word arguments to pass to the TileLayer constructor.
     52 """
     53 if isinstance(basemap, xyzservices.lib.TileProvider):
---> 54     url = basemap.build_url(time=day)
     55 elif isinstance(basemap, dict):
     56     url = basemap.get("url", "")

File ~/.local/lib/python3.8/site-packages/xyzservices/lib.py:451, in TileProvider.build_url(self, x, y, z, scale_factor, fill_subdomain, **kwargs)
    448 provider.update(kwargs)
    450 if provider.requires_token():
--> 451     raise ValueError(
    452         "Token is required for this provider, but not provided. "
    453         "You can either update TileProvider or pass respective keywords "
    454         "to build_url()."
    455     )
    457 url = provider.pop("url")
    459 if scale_factor:

ValueError: Token is required for this provider, but not provided. You can either update TileProvider or pass respective keywords to build_url().
12rambau commented 2 years ago

we are simply using an overdated version of geemap (0.8.9). I unpinned it in the requirements.txt file but it still require some testing before being shipped to prod. In the meantime, simply install the last one locally (geemap==0.16.1) and then drop the local version of ipyleaflet (it will be set to 0.17 instead of 0.16) and earthengine-api (set to 0.1.137 instead of our custom fork 0.0.270).