randyzwitch / streamlit-folium

Streamlit Component for rendering Folium maps
https://folium.streamlit.app/
MIT License
468 stars 176 forks source link

Example doesn't render in JupyterLab #130

Closed stepsbystep closed 1 year ago

stepsbystep commented 1 year ago

I tried to run your basic example in JupyterLab:

import folium
import streamlit as st

from streamlit_folium import st_folium

# center on Liberty Bell, add marker
m = folium.Map(location=[39.949610, -75.150282], zoom_start=16)
folium.Marker(
    [39.949610, -75.150282], popup="Liberty Bell", tooltip="Liberty Bell"
).add_to(m)

# call to render Folium map in Streamlit
st_data = st_folium(m, width=725)

I get this message back:

023-06-28 23:32:43.767 
  Warning: to view this Streamlit app on a browser, run it with the following
  command:

    streamlit run C:\Users\howno\anaconda3\lib\site-packages\ipykernel_launcher.py [ARGUMENTS]

I don't have rendering problems with folium, displaying map "m" directly works just fine.

randyzwitch commented 1 year ago

Streamlit apps aren't intended to run inside Jupyterlab, as Streamlit starts its own webserver. Until such time that Streamlit supports that, streamlit-folium won't be able to support it either.