# AttributeError: module 'streamlit' has no attribute 'form'

**URL:** <https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-form/22214>\
**Category:** Using Streamlit\
**Created:** [February 16, 2022, 8:39pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-form/22214 "2022-02-16T20:39:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renan\_Lopes](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/renan_lopes/32/13614_2.png) [@Renan\_Lopes](https://discuss.streamlit.io/u/Renan_Lopes)\
**Post date:** [February 16, 2022, 8:39pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-form/22214/1 "2022-02-16T20:39:43Z")

</div>

Hi,

I am trying to test the default code for forms, and there is appearing the message: AttributeError: module ‘streamlit’ has no attribute ‘form’.

Below is the code (from Streamlit website).

```auto
with st.form("my_form"):
    st.write("Inside the form")
    slider_val = st.slider("Form slider")
    checkbox_val = st.checkbox("Form checkbox")

    # Every form must have a submit button.
    submitted = st.form_submit_button("Submit")
    if submitted:
        st.write("slider", slider_val, "checkbox", checkbox_val)

st.write("Outside the form")

```

Thank you.

---

<div class="post-metadata">

**Author:** ![snehankekre](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/snehankekre/32/6504_2.png) [@snehankekre](https://discuss.streamlit.io/u/snehankekre)\
**Post date:** [February 17, 2022, 5:32am UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-form/22214/2 "2022-02-17T05:32:33Z")

</div>

Hi @Renan_Lopes, welcome to the Streamlit community!! 👋 🥳

What version of the Streamlit library are you using? You can find out by including the following line above your st.form block:

```python
st.write("Streamlit version:", st. __version__ )

```

Or by running the following in your terminal:

```
streamlit version show

```

We [released](https://docs.streamlit.io/library/changelog#version-0811) `st.form` and `st.form_submit_button` in Streamlit [v0.81.1](https://docs.streamlit.io/library/changelog#version-0811) in April 2021. 😱 If printing the version above confirms you’re running an older version, I highly recommend upgrading to the latest version to use all the cool features we’ve released since then.

To upgrade, run the following from your terminal:

```bash
pip install --upgrade streamlit
streamlit version

```

Source: [How do I upgrade to the latest version of Streamlit? - Streamlit Docs](https://docs.streamlit.io/knowledge-base/using-streamlit/how-upgrade-latest-version-streamlit)

_Happy Streamlit-ing!_ 🎈  
_Snehan_

---

<div class="post-metadata">

**Author:** ![Renan\_Lopes](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/renan_lopes/32/13614_2.png) [@Renan\_Lopes](https://discuss.streamlit.io/u/Renan_Lopes)\
**Post date:** [February 17, 2022, 9:40am UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-form/22214/3 "2022-02-17T09:40:19Z")

</div>

Hi @snehankekre!

Yes, my version was 0.75.0. I updated according with your suggestion and it worked.

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [February 17, 2023, 9:41am UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-form/22214/4 "2023-02-17T09:41:10Z")

</div>

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