jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.47k stars 359 forks source link

Error displaying widget: model not found #1182

Closed teagamrs closed 4 months ago

teagamrs commented 4 months ago

Hello,

i'm trying to use ipyleaflet with geemap, map function. I wasn't capable to make it work for Jupyter Lab 3.6.7 (also not in 4.0.11, but the issues seems to appear more frequently in 4+ so I downgraded). In Jupyter Notebook version 6.5.4 the function works properly. I'm using an env with Python 3.10.13.

What I've already tried: I've followed the instructions in https://leafmap.org/installation/#upgrade-leafmap and also the main issues reported like https://github.com/jupyter-widgets/ipyleaflet/issues/739. None of the solutions worked for me. Including restart, hard reset, close browser, refresh windows, all after the installations/updates.

My jupyter lab extension list output:

JupyterLab v3.6.7
/home/...../anaconda3/envs/insar/share/jupyter/labextensions
        jupyterlab-plotly v5.19.0 enabled OK
        ipysheet v0.7.0 enabled OK (python, ipysheet)
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        ipyevents v2.0.1 enabled OK
        bqplot v0.5.44 enabled OK (python, bqplot)
        ipytree v0.2.2 enabled OK
        jupyter-leaflet v0.18.2 enabled OK
        @pyviz/jupyterlab_pyviz v2.3.2 enabled OK (python, pyviz_comms)
        @jupyter-widgets/jupyterlab-manager v3.1.7 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /home/..../anaconda3/envs/insar/share/jupyter/lab
        js v0.1.0 enabled OK

The following source extensions are overshadowed by older prebuilt extensions:
    @jupyter-widgets/jupyterlab-manager

I really couldn't identify what I'm missing. Thank you

giswqs commented 4 months ago

Try creating a fresh conda env to install geemap

conda create -n gee python=3.11 conda activate gee conda install -n base mamba -c conda-forge mamba install geemap -c conda-forge

teagamrs commented 4 months ago

mamba install geemap -c conda-forge

This one isn't working, any sugestions?

mamba install geemap -c conda-forge
argument COMMAND: conflicting subparser: repoquery

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/.../anaconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/home/.../anaconda3/lib/python3.11/site-packages/mamba/mamba.py", line 945, in exception_converter
        raise e
      File "/home/.../anaconda3/lib/python3.11/site-packages/mamba/mamba.py", line 938, in exception_converter
        exit_code = _wrapped_main(*args, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/.../anaconda3/lib/python3.11/site-packages/mamba/mamba.py", line 877, in _wrapped_main
        configure_parser_repoquery(p._subparsers._group_actions[0])
      File "/home/..../anaconda3/lib/python3.11/site-packages/mamba/mamba.py", line 805, in configure_parser_repoquery
        p = sub_parsers.add_parser(
            ^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/.../anaconda3/lib/python3.11/argparse.py", line 1192, in add_parser
        raise ArgumentError(self, _('conflicting subparser: %s') % name)
    argparse.ArgumentError: argument COMMAND: conflicting subparser: repoquery

`$ /home/.../anaconda3/condabin/mamba install geemap -c conda-forge`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=engine
                CONDA_EXE=/home/.../anaconda3/bin/conda
             CONDA_PREFIX=/home/.../anaconda3/envs/engine
           CONDA_PREFIX_1=/home/.../anaconda3
    CONDA_PROMPT_MODIFIER=(engine)
         CONDA_PYTHON_EXE=/home/.../anaconda3/bin/python
               CONDA_ROOT=/home/,,,/anaconda3
              CONDA_SHLVL=2
           CURL_CA_BUNDLE=<not set>
         GMT_LIBRARY_PATH=/home/.../anaconda3/envs/interferometry/lib
               LD_PRELOAD=<not set>
                     PATH=/home/.../anaconda3/envs/engine/bin:/home/.../anaconda3/cond
                          abin:/usr/local/GMTSAR/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/u
                          sr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/...
                          /.local/bin:/home/youruserdirectory/anaconda3/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : engine
    active env location : /home/.../anaconda3/envs/engine
            shell level : 2
       user config file : /home/.../.condarc
 populated config files : 
          conda version : 23.7.4
    conda-build version : 3.28.2
         python version : 3.11.5.final.0
       virtual packages : __archspec=1=zen3
                          __glibc=2.35=0
                          __linux=6.5.0=0
                          __unix=0=0
       base environment : /home/.../anaconda3  (writable)
      conda av data dir : /home/.../anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/.../anaconda3/pkgs
                          /home/.../.conda/pkgs
       envs directories : /home/.../anaconda3/envs
                          /home/.../.conda/envs
               platform : linux-64
             user-agent : conda/23.7.4 requests/2.31.0 CPython/3.11.5 Linux/6.5.0-21-generic ubuntu/22.04.4 glibc/2.35
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
giswqs commented 4 months ago

Try

conda create -n gee python=3.11 conda activate gee pip install geemap

teagamrs commented 4 months ago

It's working with the new env. Thank you!!