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: AttributeError: 'LinearColormap' object has no attribute 'default_css' #209

Closed
connortann opened this issue Sep 4, 2024 · 2 comments

Comments

@connortann
Copy link

I encountered this error with st_folium(map), with version 0.20.1.

AttributeError: 'LinearColormap' object has no attribute 'default_css'

Code example

import geopandas as gdp
from streamlit_folium import st_folium

gdf = gpd.GeoDataFrame(...)
m = gdf.explore("col")
st_folium(m, use_container_width=True)

Full traceback

File ".../lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^
File ".../lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec
    exec(code, module.__dict__)
File "/foo/app.py", line 32, in <module>
    page.run()
File ".../lib/python3.11/site-packages/streamlit/navigation/page.py", line 291, in run
    exec(code, module.__dict__)
File "/foo/bar.py", line 77, in <module>
    main(st.session_state.df)
File "/foo/bar.py", line 12, in main
    show_map(df)
File "/foo/bar.py", line 74, in show_map
    st_folium(m, use_container_width=True)
File ".../lib/python3.11/site-packages/streamlit_folium/__init__.py", line 393, in st_folium
    css_links.extend([href for _, href in elem.default_css])
                                          ^^^^^^^^^^^^^^^^

Discussion

Possibly related:

@randyzwitch
Copy link
Owner

Please upgrade your streamlit-folium version and try again.

@connortann
Copy link
Author

Ah, yes it is fixed on the latest version. Apologies, I thought I was already on the latest but I was mistaken!

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

No branches or pull requests

2 participants