1

I was trying to test out this script https://github.com/tylere/PyDataNYC2017/blob/master/ipynb/satellite_analysis.ipynb but got stuck at the iteractive mapping part.

import ipyleaflet
map1 = ipyleaflet.Map(zoom=3, layout={'height':'400px'})
dc = ipyleaflet.DrawControl()
map1.add_control(dc)
map1

It produces something like this:

Map(basemap={'url': 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 'max_zoom': 19, 'attribution': 'Map …

ipywidgets package also produces something similar:

VBox(children=(Map(basemap={'url': 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 'max_zoom': 19, 'attr…

Then I tested it using jupyter nbextension list but it shows me:

Known nbextensions:.

Then I try to fix it according to this post https://github.com/jupyter-widgets/ipyleaflet/issues/173

jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-leaflet

However, in Command line it shows me

Error executing Jupyter command 'labextension': [Errno 2] No such file or directory

I also tried this solution Ipyleaflet map object doesn't display in Jupyter Notebook but it gets created

jupyter nbextension enable --py --sys-prefix ipyleaflet

shows me error messages:

Traceback (most recent call last): File "/home/gjiang/.local/bin/jupyter-nbextension", line 11, in <module> sys.exit(main()) File "/home/gjiang/.local/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File "/home/gjiang/.local/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance app.start() File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 988, in start super(NBExtensionApp, self).start() File "/home/gjiang/.local/lib/python3.6/site-packages/jupyter_core/application.py", line 255, in start self.subapp.start() File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 896, in start self.toggle_nbextension_python(self.extra_args[0]) File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 872, in toggle_nbextension_python logger=self.log) File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 483, in enable_nbextension_python logger=logger) File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 386, in _set_nbextension_state_python for nbext in nbexts] File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 386, in <listcomp> for nbext in nbexts] File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 351, in _set_nbextension_state cm.update(section, {"load_extensions": {require: state}}) File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/config_manager.py", line 136, in update self.set(section_name, data) File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/config_manager.py", line 110, in set self.ensure_config_dir_exists() File "/home/gjiang/.local/lib/python3.6/site-packages/notebook/config_manager.py", line 67, in ensure_config_dir_exists os.makedirs(self.config_dir, 0o755) File "/usr/lib/python3.6/os.py", line 210, in makedirs makedirs(head, mode, exist_ok) File "/usr/lib/python3.6/os.py", line 210, in makedirs makedirs(head, mode, exist_ok) File "/usr/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/usr/etc'

I'm using python 3.6.7 (default, Oct 22 2018, 11:32:17) on jupyter notebook on Ubuntu 18.04

0

At least the last command needs to be sudo'd so it should read:

sudo jupyter nbextension enable --py --sys-prefix ipyleaflet

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.