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


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

`TypeError: ‘list’ object is not callable

File “\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\”, line 565, in _run_script
exec(code, module.dict)
File “<streamlit_python_file_loc>\”, line 5, in
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")

with col2:
   st.header("A dog")

with col3:
   st.header("An owl")

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

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