Leafmap import error #445
-
I am trying to run a simple code give here: import streamlit as st
import leafmap.kepler as leafmap
st.header("Hello") When I run the streamlit application:
I am getting this error in my terminal: Please restart Jupyter kernel after installation if you encounter any errors when importing leafmap.
2023-05-15 10:47:13.544 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\leafmap\__init__.py", line 32, in <module>
from .leafmap import *
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\leafmap\leafmap.py", line 15, in <module>
basemaps = Box(xyz_to_leaflet(), frozen_box=True)
^^^^^^^^^^^^^^^^
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\leafmap\basemaps.py", line 282, in xyz_to_leaflet
leaflet_dict[key] = ipyleaflet.TileLayer(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\ipyleaflet\leaflet.py", line 626, in __init__
super(TileLayer, self).__init__(**kwargs)
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\ipyleaflet\leaflet.py", line 158, in __init__
super(Layer, self).__init__(**kwargs)
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\ipywidgets\widgets\widget.py", line 480, in __init__
self.open()
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\ipywidgets\widgets\widget.py", line 511, in open
self.comm = create_comm(**args)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\comm\__init__.py", line 27, in _create_comm
raise NotImplementedError("Cannot ")
NotImplementedError: Cannot
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.__dict__)
File "C:\Users\kbora\OneDrive - BuroHappold\Projects and Tutorials\Qiddiya\Dashboard v3\development\pydeck map rendering\pydeck_app.py", line 4, in <module>
import leafmap.kepler as leafmap
File "C:\Users\kbora\Anaconda3\envs\gis_env\Lib\site-packages\leafmap\__init__.py", line 42, in <module>
raise Exception(e)
Exception: Cannot Can anyone help me resolve this error |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It looks like you're encountering an issue with the Here are a few steps you can try to resolve this:
|
Beta Was this translation helpful? Give feedback.
It looks like you're encountering an issue with the
leafmap
library when running your Streamlit application. This error might be related to compatibility issues betweenleafmap
andipyleaflet
oripywidgets
.Here are a few steps you can try to resolve this:
Update Packages: Ensure all your packages are up to date. You can do this by running:
Restart Jupyter Kernel: If you are running this in a Jupyter environment, try restarting the kernel after updating the packages.
Check Environment: Make sure you are using the correct Python environment. Sometimes, conflicts arise from using different environments.
Use Static Map: If the issue…