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?