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.