AttributeError: module 'streamlit' has no attribute 'tabs'

I’m having trouble making tabs in streamlit 1.12.0
Basic example:

import streamlit as st
tab1, tab2 = st.tabs([‘First’, ‘Second’])
with tab1:
st.write(‘First tab’)
with tab2:
st.write(‘Second tab’)

The error is, as in the subject:

AttributeError: module ‘streamlit’ has no attribute ‘tabs’


HI @sslederer :wave:

You likely have multiple Streamlit installations on your machine. To confirm this is the case, display the Streamlit version within the same app:

import streamlit as st

with st.echo():
    st.write(f"streamlit version: {st.__version__}")

    tab1, tab2 = st.tabs(["First", "Second"])
    with tab1:
        st.write("First tab")
    with tab2:
        st.write("Second tab")

If you could share a screenshot of the entire app with the above code, I’d wager the displayed version is not 1.12.0.

It shows 1.12.0, which is the same as I get when I put “streamlit version” in the terminal

Thanks for your help!

Should I uninstall and reinstall?

I am seeing the same issue myself. My version is 1.10!

You need a more recent streamlit to use tabs.

Hi. I have the same issues. Updated the requirements.txt but still get the same error


It works fine when hosted locally, but it’s not available when deployed on Streamlit Cloud.

Update: after changing the version, need to reboot the app. Thanks. SOLVED.