Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][Jupyter Widget] Map Does Not Display #583

Open
suciokhan opened this issue Jun 26, 2019 · 37 comments
Open

[Bug][Jupyter Widget] Map Does Not Display #583

suciokhan opened this issue Jun 26, 2019 · 37 comments
Assignees
Labels
jupyter keplergl for Jupyter

Comments

@suciokhan
Copy link

suciokhan commented Jun 26, 2019

Describe the bug
Unable to render KeplerGL map in Jupyter-lab version 0.35.6 and Python 3.6.8 on Ubuntu 18.04.2 LTS Virtual Box VM. As per the example, I set KeplerGl(height=500) to a variable & call that variable, but neither an image nor error message is displayed.

To Reproduce
Steps to reproduce the behavior:

Behaves as expected

  1. from keplergl import KeplerGl

Prints URL to user guide

  1. map = KeplerGl(height=400)

prints "KeplerGL(). No image displayed

  1. map

Expected behavior
Expected a basic map to be rendered, as per example found at https://medium.com/vis-gl/introducing-kepler-gl-for-jupyter-f72d41659fbf

Screenshots
image

Environment (please complete the following information):

  • Python version: 3.6.8
  • keplergl Widget version : 0.1.0a6

Additional context
Installation executed via sudo pip3 install keplergl. My friend is experiencing the same error; I do not have his system details however.

@suciokhan suciokhan added the jupyter keplergl for Jupyter label Jun 26, 2019
@suciokhan suciokhan reopened this Jun 26, 2019
@suciokhan
Copy link
Author

Whoops wrong button

@dash-alex
Copy link

same problem here, and with some other error info
image

@heshan0131
Copy link
Contributor

heshan0131 commented Jun 27, 2019

@dash-alex Unfortunately, ipywidget (what keplergl is built upon) doesn't wrok in JupyterLabs.
There is a stackoverflow thread here:
https://stackoverflow.com/questions/49542417/how-to-get-ipywidgets-working-in-jupyter-lab

"
JupyterLab now prefers a model where arbitrary javascript is no longer allowed to be embedded in a cell's output, which is how many interactive Jupyter Notebook modules used to work. They now ask that modules with interactivity create a JupyterLab extension.
"

Looks like in order for kepler.gl to work in JupterLab, we have to create yet another extension :(

@dash-alex
Copy link

@dash-alex Are you running it in JupyterLab or Jupyter Notebook?

Jupyter Notebook

@suciokhan
Copy link
Author

suciokhan commented Jun 27, 2019

@dash-alex Are you running it in JupyterLab or Jupyter Notebook?

Jupyter Notebook

Yes, I was using JupyterLab. That's good to know; thanks very much for clarifying.

@heshan0131
Copy link
Contributor

heshan0131 commented Jun 27, 2019

But @dash-alex you are using Jupyter Notebook and still see console error? Can you describe how you are running it? which version of ipywidgets is installed in your environment?

@kathrine-swe
Copy link

Dropping a plug: It would be really awesome if you guys made the extension for JupyterLab.

@dash-alex
Copy link

@heshan0131

nbextension:
jupyter nbextension list|grep widget
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
      - Validating: OK
      - Validating: OK
      - Validating: OK
      - Validating: OK
      - Validating: OK
      - Validating: OK
      - Validating: OK
      - Validating: OK
      - Validating: problems found:
        - require?  X rise/main
      - Validating: OK
      - Validating: problems found:
        - require?  X nb_conda
      - Validating: problems found:
        - require?  X bokeh
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main
      - Validating: OK
      - Validating: OK
      - Validating: OK
      - Validating: OK
      jupyter-js-widgets/extension  enabled
      jupyter-js-widgets/extension  enabled
ipywidgets:
ipywidgets                7.4.2                      py_0    conda-forge
kepler:
keplergl                  0.1.0a6                  pypi_0    pypi
jupyter version:
jupyter 4.4.0

image

@adityamangal410
Copy link

@heshan0131 I am seeing the same issue in jupyter notebook too (not lab) -

image

@a2q
Copy link

a2q commented Jun 29, 2019

But @dash-alex you are using Jupyter Notebook and still see console error? Can you describe how you are running it? which version of ipywidgets is installed in your environment?

I have the same problem, empty display
keplergl 0.1.0a6
ipywidgets 7.4.2
jupyter 1.0.0
Python 3.6.7
windows 10

@ohld
Copy link

ohld commented Jul 1, 2019

The same for me on the bleeding edge jupyter notebook, python3.7, mac os

@ohld
Copy link

ohld commented Jul 1, 2019

In Jupyter console log I can see this error:

[W 13:38:46.266 NotebookApp] 404 GET /static/keplergl-jupyter.js?v=20190701133836 (::1) 16.42ms referer=http://localhost:8888/notebooks/first_look.ipynb

@ohld
Copy link

ohld commented Jul 1, 2019

And my browser's console log is:
image

@etherruzo
Copy link

etherruzo commented Jul 12, 2019

Same issue. KeplerGL widget map does not display in jupyter notebook:

ipywidgets==7.5.0
jupyter-client==5.3.0
jupyter-core==4.5.0
keplergl==0.1.0a7
python 3.7.3

After downgrading jupyter-client it succesfully displays the map:

pip install jupyter-client==5.2.4

@etherruzo
Copy link

etherruzo commented Jul 30, 2019

kepler maps not being displayed in Python 3.7.3 I upload the consoles log.

ipykernel==5.1.1
ipython==7.7.0
ipywidgets==7.5.1
jupyter-client==5.2.4
jupyter-core==4.5.0
keplergl==0.1.0a7
widgetsnbextension==3.5.1

Captura de pantalla (21)

@heshan0131
Copy link
Contributor

Thanks. I was able to reproduce similar issue with python 3. Will investigate

@heshan0131
Copy link
Contributor

heshan0131 commented Jul 31, 2019

Did some digger today. I assume people who don't see a map display and have an error msg like
GET http://noteboworkbench....com/static/keplergl-jupyter.js?v=20190701133836 404

are using windows? This means keplergl extension is not installed and enabled, despite the fact keplergl python package is installed successfully.

Try run the command below, see if any luck.

jupyter nbextension install --py --sys-prefix keplergl
jupyter nbextension enable --py --sys-prefix keplergl

use --sys-prefix if you are using virtualenv or conda.

A longer explanation

When installing keplergl as a widget using pip, 3 things need to happen:

  1. The source files and egg-info are copied to /usr/local/anaconda3/lib/python3.6/site-packages
  2. The files in folder keplergl/static are copied to share/jupyter/nbextensions/keplergl-jupyter
  3. the keplergl-jupyter.json file is copied to etc/jupyter/nbconfig/notebook.d

step 2 and 3 register keplergl with nbextension, and if not properly setup, jupyter will fail to load the extension, hence the GET http://dsw....com/static/keplergl-jupyter.js 404 error.

You can us jupyter --paths to check where jupyter install extensions:

$ jupyter --paths
config:
    /Users/Olivier/.jupyter
    /usr/local/anaconda3/etc/jupyter
    /usr/local/etc/jupyter
    /etc/jupyter
data:
    /Users/Olivier/Library/Jupyter
    /usr/local/anaconda3/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter
runtime:
    /Users/Olivier/Library/Jupyter/runtime

The flag --sys-prefix means extension are installed in this data folder:

/usr/local/anaconda3/share/jupyter

when using pip install kepler.gl the setup.py should set it up automatically, so you don't have to run the above 2script.

However, if you are using conda. Since we havn't publish keplergl to conda-forge, the setup will not go through 2, 3 step. So you have to manually do it.

I created a FR to publish keplergl to conda #646

Hope this help. I also don't have a windows machine to go through these steps, so it would be great if any of you can post your result

@etherruzo
Copy link

etherruzo commented Jul 31, 2019

I was using ubuntu 16.04.6. I confirm it worked, now the map is being displayed.

pip install --upgrade jupyterthemes
jupyter nbextension install --py --sys-prefix keplergl
jupyter nbextension enable --py --sys-prefix keplergl

@oliverclock
Copy link

oliverclock commented Aug 2, 2019

Hi - I had this issue in regards to no map showing, and a link to the user guide. I am running Anaconda 4.6.8, Jupyter Notebook and Python 3.7.1 on Windows 10. The above suggestion worked and the map is now showing, i.e.

pip install --upgrade jupyterthemes
jupyter nbextension install --py --sys-prefix keplergl
jupyter nbextension enable --py --sys-prefix keplergl

Thank you - excited to give this a go!

@eWizardII
Copy link

@oliverclock @etherruzo I tried the steps you used in AWS Sagemaker without any luck are there any other steps you guys have tried? Thanks!

@ABIvan-Tech
Copy link

ABIvan-Tech commented Oct 8, 2019

I also had similar problem like @suciokhan @dash-alex and others good peoples
My system config:
Windows 10 Pro x64. Python 3.7.3 x64
Anaconda 1.9.7 x64/Notebook 6.0.1/JupyterLab 1.1.4

This is my way to solve this problem:

  1. pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --user numpy bottleneck pandas shapely wheel munch cligj click-plugins pyproj pyparsing matplotlib kiwisolver cycler ply
  2. U can go to https://pypi.org/project/GDAL/ and folow windows instructions or
    install Generic installer for the GDAL core components https://www.gisinternals.com/query.html?content=filelist&file=release-1911-x64-gdal-3-0-0-mapserver-7-4-0.zip
    then install GDAL 2.4.1 (coz GDAL 3.x.x dose not support Fiona) & Fiona 1.8.6 from whl packages
    https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona
    https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
    python -m pip install c:\GDAL-2.4.1-cp37-cp37m-win_amd64.whl
    python -m pip install c:\Fiona-1.8.6-cp37-cp37m-win_amd64.whl
  3. pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org geopandas
  4. pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org keplergl
  5. Be shure that keplergl extension is installed and enabled into Jupyter
    5.1 jupyter nbextension install --py --sys-prefix keplergl # can be skipped for notebook 5.3 and above
    5.2 jupyter nbextension enable --py --sys-prefix keplergl # can be skipped for notebook 5.3 and above
    #Optional:
  6. Install NodeJs from Anaconda Navigator
  7. Install "jupyter labextension install @jupyter-widgets/jupyterlab-manager keplergl-jupyter"
  8. pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --upgrade jupyterthemes

At this moment i can run and work with keplergl into JupyterLab but still cannot run it into Notebook.

@heshan0131
Copy link
Contributor

@alex-soft-r
It's weird it works on Labs but not Notebook. (usually the other way around)
What's your version of ipywidgets?

@ABIvan-Tech
Copy link

ipywidgets

image

@ABIvan-Tech
Copy link

ABIvan-Tech commented Oct 9, 2019

This is what i can see when try use KeplerGL at Notebook
image

@heshan0131
Copy link
Contributor

heshan0131 commented Oct 9, 2019

@alex-soft-r I am confused. If you installed keplergl with p install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org keplergl why is the widget reports syntax error at my personal directory?
/User/shanhe/Uber/kepler.gl/bingdings...

Okay. I think I figured out why. Will investigate more today

@heshan0131
Copy link
Contributor

My bad :(... the 0.1.0 built was broken. please upgrade to keplergl==0.1.1 now

@ABIvan-Tech
Copy link

ABIvan-Tech commented Oct 10, 2019

My bad :(... the 0.1.0 built was broken. please upgrade to keplergl==0.1.1 now

just one moment :) ...

Now all is OK!!! Kepler work both on Lab and Notebook

Great Job!! Please Continue it!
image

@xiancode
Copy link

tks @alex-soft-r
install these extension :
jupyter labextension install @jupyter-widgets/jupyterlab-manager keplergl-jupyter
it can work.

@arnabbiswas1
Copy link

Unfortunately it still does not work for me. I have installed version 0.1.2.

@amr544
Copy link

amr544 commented Nov 17, 2019

Same for me, version 0.1.2
image

@HugoBarreto
Copy link

I have similar issue with Google Colab on Pyhton3 kernel

@CNFeffery
Copy link

Unfortunately it still does not work for me. I have installed version 0.1.2.

You can read the offical tutorial https://github.com/keplergl/kepler.gl/tree/master/bindings/kepler.gl-jupyter

@koyo-jakanees
Copy link

I had a similar issue on colab too @HugoBarreto ,managed to install but map was not showing. when trying to install the extension i realized colab jupyter was defauliting to python 2.7 dist -packages but I installed to py3.
solved it by installing to py2.7 using pip2
but the map display issue was still not persistent
error

@trianta2
Copy link

I've followed the user guide and many of the hints here, but I still cannot get the widget working in Jupyter Lab. The widget does work in Jupyter Notebook however.

Python 3.6, macOS 10.14.5

jupyter-client==5.3.4
jupyter-core==4.6.1
jupyterlab==2.0.1
jupyterlab-server==1.0.7
jupyterthemes==0.20.0
ipykernel==5.1.3
ipython==7.11.1
ipython-genutils==0.2.0
ipywidgets==7.5.1
keplergl==0.1.2
$ node --version
v13.8.0

@SKYNET-123
Copy link

So I am having the same trouble urg!!
Jupyter 1.26
python 3.76
kepler 0.1.2
have enabled keplergl-jypyter
enabled jupyterlab-manager

Don't know whats going on.

@rogergangawork
Copy link

rogergangawork commented Apr 23, 2020

I am getting the following:

User Guide: https://github.com/keplergl/kepler.gl/blob/master/docs/keplergl-jupyter/user-guide.md
KeplerGl(height=600)

Am finding this in my console:

image

I have installed keplergl-jupyter and jupyterlabs manager widgets

Update:

For some reason. I switched from jupyter lab to jupyter notebook and it worked 😐

@cipri-tom
Copy link

Did some digger today. I assume people who don't see a map display and have an error msg like
GET http://noteboworkbench....com/static/keplergl-jupyter.js?v=20190701133836 404

are using windows?

Not necessarily, but probably they have a split setup (see below). I am on macOS

This means keplergl extension is not installed and enabled, despite the fact keplergl python package is installed successfully.

Try run the command below, see if any luck.

jupyter nbextension install --py --sys-prefix keplergl
jupyter nbextension enable --py --sys-prefix keplergl

use --sys-prefix if you are using virtualenv or conda.

This is not enough, it needs to be in the conda environment which hosts ipywidgets (which may not be the same as the environment hosting keplergl)

A longer explanation

When installing keplergl as a widget using pip, 3 things need to happen:

1. The source files and egg-info are copied to `/usr/local/anaconda3/lib/python3.6/site-packages`

2. The files in folder `keplergl/static` are copied to `share/jupyter/nbextensions/keplergl-jupyter`

3. the `keplergl-jupyter.json` file is copied to etc/jupyter/nbconfig/notebook.d

Thank you for the description! This goes a long way into describing the problem, which helped me solve it on my (maybe unusual) setup.

I have a conda environment kgl where I have run pip install keplergl. But I am starting the notebook from condas base environment, where I have nb_conda_kernels. And the kernel is the kgl environment, exposed by installing ipykernel in kgl.

So I had to follow a path similar to installing ipywidgets in multiple environments:

  1. install keplergl in kgl environment
  2. install the extension in base environment *.
  3. activate the extension in base environment.

* Note that for step 2 it is necessary to install keplergl also in base environment, otherwise the extension cannot be activated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jupyter keplergl for Jupyter
Projects
None yet
Development

No branches or pull requests