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 not rendering in AWS Sagemaker Notebook #717

Open
eWizardII opened this issue Sep 6, 2019 · 9 comments
Open
Assignees
Labels
jupyter keplergl for Jupyter

Comments

@eWizardII
Copy link

Describe the bug
In AWS sagemaker using JuypterLab or Notebook does not load the visualization of a map when running the following command.

# Load an empty map
from keplergl import KeplerGl 
map_1 = KeplerGl(height=500)
map_1

To Reproduce
Steps to reproduce the behavior:

  1. Launch a sagemaker instance in AWS
  2. Run the default conda_python3 enviornment
  3. run the following commands after using pip install for kepler.gl
# Load an empty map
from keplergl import KeplerGl 
map_1 = KeplerGl(height=500)
map_1

Expected behavior
Empty map should load when running the above command.

Screenshots

Environment (please complete the following information):

  • Python version: 3.6.5
  • keplergl Widget version - 0.1.0-a8
  • ipywidgets version - 7.5.1

Additional context
In another bug report I tried the following to no avail:

!pip install --upgrade jupyterthemes
!jupyter nbextension install --py --sys-prefix keplergl
!jupyter nbextension enable --py --sys-prefix keplergl
@eWizardII eWizardII added the jupyter keplergl for Jupyter label Sep 6, 2019
@eWizardII eWizardII changed the title [Bug][Jupyter Widget] [Bug][Jupyter Widget] Map not rendering in AWS Sagemaker Notebook Sep 6, 2019
@heshan0131
Copy link
Contributor

So it doesn't load on both jupyter notebook and jupyter lab?
Can you open the javascript console and paste in any error messaage?

Can you also paste in the version of your jupyterLab and notebook?
you can do that by calling
pip show jupyterLab
jupyter notebook --version

@LHaferkamp
Copy link

Got the same problem on AWS Sagemaker:
Jupyter notebook version is 5.5.0

Javascript Console error messages
manager-base.js:273 Could not instantiate widget (anonymous) @ manager-base.js:273 (anonymous) @ manager-base.js:44 (anonymous) @ manager-base.js:25 a @ manager-base.js:17 Promise.then (async) u @ manager-base.js:18 (anonymous) @ manager-base.js:19 A @ manager-base.js:15 t._make_model @ manager-base.js:257 (anonymous) @ manager-base.js:246 (anonymous) @ manager-base.js:44 (anonymous) @ manager-base.js:25 (anonymous) @ manager-base.js:19 A @ manager-base.js:15 t.new_model @ manager-base.js:232 t.handle_comm_open @ manager-base.js:144 L @ underscore.js:762 (anonymous) @ underscore.js:775 (anonymous) @ underscore.js:122 (anonymous) @ comm.js:89 Promise.then (async) CommManager.comm_open @ comm.js:85 i @ jquery.min.js:2 Kernel._handle_iopub_message @ kernel.js:1223 Kernel._finish_ws_message @ kernel.js:1015 (anonymous) @ kernel.js:1006 Promise.then (async) Kernel._handle_ws_message @ kernel.js:1006 i @ jquery.min.js:2

utils.js:119 Error: Could not create a model. at utils.js:119 (anonymous) @ utils.js:119 Promise.catch (async) t.handle_comm_open @ manager-base.js:149 L @ underscore.js:762 (anonymous) @ underscore.js:775 (anonymous) @ underscore.js:122 (anonymous) @ comm.js:89 Promise.then (async) CommManager.comm_open @ comm.js:85 i @ jquery.min.js:2 Kernel._handle_iopub_message @ kernel.js:1223 Kernel._finish_ws_message @ kernel.js:1015 (anonymous) @ kernel.js:1006 Promise.then (async) Kernel._handle_ws_message @ kernel.js:1006 i @ jquery.min.js:2

kernel.js:1007 Couldn't process kernel message Error: Script error for "keplergl-jupyter" http://requirejs.org/docs/errors.html#scripterror at makeError (require.js?v=951f856e81496aaeec2e71a1c2c0d51f:168) at HTMLScriptElement.onScriptError (require.js?v=951f856e81496aaeec2e71a1c2c0d51f:1735) (anonymous) @ kernel.js:1007 Promise.catch (async) Kernel._handle_ws_message @ kernel.js:1007 i @ jquery.min.js:2 jquery.min.js:2 [Violation] Added synchronous DOM mutation listener to a 'DOMNodeInserted' event. Consider using MutationObserver to make the page more responsive. add @ jquery.min.js:2 (anonymous) @ jquery.min.js:2 each @ jquery.min.js:2 each @ jquery.min.js:2 De @ jquery.min.js:2 on @ jquery.min.js:2 KeyboardManager.register_events @ keyboardmanager.js:254 n.OutputArea.register_mime_type.safe @ extension.js:144 OutputArea.append_mime_type @ outputarea.js:696 OutputArea.append_display_data @ outputarea.js:659 OutputArea.append_output @ outputarea.js:346 OutputArea.handle_output @ outputarea.js:257 output @ codecell.js:395 Kernel._handle_output_message @ kernel.js:1196 i @ jquery.min.js:2 Kernel._handle_iopub_message @ kernel.js:1223 Kernel._finish_ws_message @ kernel.js:1015 (anonymous) @ kernel.js:1006

kepler-visualization.ipynb#:1 Uncaught (in promise) Error: Script error for "keplergl-jupyter" http://requirejs.org/docs/errors.html#scripterror at makeError (require.js?v=951f856e81496aaeec2e71a1c2c0d51f:168) at HTMLScriptElement.onScriptError (require.js?v=951f856e81496aaeec2e71a1c2c0d51f:1735) Promise.then (async) t.register_model @ manager-base.js:208 (anonymous) @ manager-base.js:248 (anonymous) @ manager-base.js:44 (anonymous) @ manager-base.js:25 (anonymous) @ manager-base.js:19 A @ manager-base.js:15 t.new_model @ manager-base.js:232 t.handle_comm_open @ manager-base.js:144 L @ underscore.js:762 (anonymous) @ underscore.js:775 (anonymous) @ underscore.js:122 (anonymous) @ comm.js:89 Promise.then (async) CommManager.comm_open @ comm.js:85 i @ jquery.min.js:2 Kernel._handle_iopub_message @ kernel.js:1223 Kernel._finish_ws_message @ kernel.js:1015 (anonymous) @ kernel.js:1006 Promise.then (async) Kernel._handle_ws_message @ kernel.js:1006 i @ jquery.min.js:2
kepler-visualization.ipynb#:1 Uncaught (in promise) Error: Script error for "keplergl-jupyter" http://requirejs.org/docs/errors.html#scripterror at makeError (require.js?v=951f856e81496aaeec2e71a1c2c0d51f:168) at HTMLScriptElement.onScriptError (require.js?v=951f856e81496aaeec2e71a1c2c0d51f:1735)

@heshan0131
Copy link
Contributor

Clean you clarify if you got the error in Jupyter Notebook or Jupyter Lab? If it's Lab, you actually have to install jupyter labextension install @jupyter-widgets/jupyterlab-manager keplergl-jupyter
and have node >= 8.15.0

Couple of things you ca try:

  1. keplergl==0.1.0 build is broken, is you are on it, try install 0.1.1

  2. Since your sagemaker Notebook is on conda-python env, maybe follow instructions here:
    Error install keplergl jupyter widget in windows: Failed building wheel #557 (comment)

  3. The error msg is hard to read. usually there should be something before manager-base.js:273 Could not instantiate widget (anonymous). Could you paste a screenshot of your js console?

@LHaferkamp
Copy link

The error is on Jupyter Notebook, I could try Jupyter Lab as this is an option on AWS.
But for Jupyter Notebook:

  1. I just upgraded to keplergl-0.1.1 but it didn't help
  2. AWS Sagemaker runs on linux_x86_64, the instructions of Error install keplergl jupyter widget in windows: Failed building wheel #557 for Windows won't help, e.g. for Shapely https://pypi.org/project/Shapely/ there is no manual wheel installation option
  3. There was no other error message before, I will get a screenshot as soon as I have it running again
    I will try to install some of the mentioned packages like shapely via conda on Sagemaker, but any other ideas are welcome

@LHaferkamp
Copy link

LHaferkamp commented Oct 19, 2019

@heshan0131 : You were right, on a plain new notebook loading an empty map shows now a HTTP 404 error on the console (the 404 doesn't appear on second try)

Loading extension: nb_conda/main
Loading extension: jupyter-js-widgets/extension
GET https://MY_NOTEBOOK.notebook.eu-west-1.sagemaker.aws/static/keplergl-jupyter.js?v=20191007202311 net::ERR_ABORTED 404 (Not Found)

@RafaMenezes
Copy link

@heshan0131 : You were right, on a plain new notebook loading an empty map shows now a HTTP 404 error on the console (the 404 doesn't appear on second try)

Loading extension: nb_conda/main
Loading extension: jupyter-js-widgets/extension
GET https://MY_NOTEBOOK.notebook.eu-west-1.sagemaker.aws/static/keplergl-jupyter.js?v=20191007202311 net::ERR_ABORTED 404 (Not Found)

Were you able to solve the problem? I am trying to run another widget in a notebook instance from SageMaker and can't make it work. It works just fine on a local notebook, but not on the remote notebook instance.

@LHaferkamp
Copy link

@RafaMenezes : No, unfortunately not, I assume its a problem with AWS and where the static files of the extensions are stored

@ankitgoel888
Copy link

I have same issue. Any update? v 0.2.0 and still not loading on sagemaker

@rogergangawork
Copy link

Same issue with Sagemaker here

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

6 participants