St.columns returning an error (even the example in Streamlit docs)

Summary

Hello. Every time I try to use columns it returns the following error

`TypeError: โ€˜listโ€™ object is not callable
Traceback:

File โ€œ\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.pyโ€, line 565, in _run_script
exec(code, module.dict)
File โ€œ<streamlit_python_file_loc>\main.pyโ€, line 5, in
st.columns()`
Again, this happens even when I use the example code in Streamlit docs

Steps to reproduce

Code snippet:

import streamlit as st

col1, col2, col3 = st.columns(3)

with col1:
   st.header("A cat")
   st.image("https://static.streamlit.io/examples/cat.jpg")

with col2:
   st.header("A dog")
   st.image("https://static.streamlit.io/examples/dog.jpg")

with col3:
   st.header("An owl")
   st.image("https://static.streamlit.io/examples/owl.jpg")

Can anyone help me please? I really donโ€™t see why it shouldnโ€™t work - just downloaded Streamlit and tried using it for the first time when I encountered this.

Debug info

  • Streamlit version: 1.17.0
  • Python version: 3.10
  • OS version: Windows 10
1 Like

Close the terminal in which your app is running and try again.

1 Like

My bad, thanks โ€ฆ that solved (?) it

You probably wrote and ran some code like this

st.columns = some_list

Instead of properly calling it. Then you changed the code but the application remembers that until you restart it.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.