# AttributeError: module 'streamlit' has no attribute 'chat\_input'

**URL:** <https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197>\
**Category:** Using Streamlit\
**Created:** [June 28, 2023, 11:35am UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197 "2023-06-28T11:35:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aryakris17](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Aryakris17](https://discuss.streamlit.io/u/Aryakris17)\
**Post date:** [June 28, 2023, 11:35am UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/1 "2023-06-28T11:35:03Z")

</div>

Hi, I am new to Streamlit and I am trying to build a conversational app using this tutorial :  
[https://docs.streamlit.io/knowledge-base/tutorials/build-conversational-apps](https://docs.streamlit.io/knowledge-base/tutorials/build-conversational-apps)  
However, I am getting this error : `AttributeError: module 'streamlit' has no attribute 'chat_input'`  
I have removed all the other code and this is the only code I have :

```auto
import streamlit as st

prompt = st.chat_input("Say something")
if prompt:
    st.write(f"User has sent the following prompt: {prompt}")

```

My streamlit version is 1.23.1

---

<div class="post-metadata">

**Author:** ![Goyo](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/goyo/32/28219_2.png) [@Goyo](https://discuss.streamlit.io/u/Goyo)\
**Post date:** [June 28, 2023, 11:42am UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/2 "2023-06-28T11:42:23Z")

</div>

Your streamlit is [too old](https://docs.streamlit.io/library/changelog#version-1240).

---

<div class="post-metadata">

**Author:** ![Aryakris17](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Aryakris17](https://discuss.streamlit.io/u/Aryakris17)\
**Post date:** [June 28, 2023, 11:49am UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/3 "2023-06-28T11:49:58Z")

</div>

```auto
pip install --upgrade streamlit

```

doing this does not upgrade to 1.24.0. What can I do?

I uninstalled and re-installed streamlit using

```auto
pip install streamlit==1.24.0

```

However, there seems to be some sort of discrepancy.  
`pip list` shows the version of streamlit as 1.24.0, but the command `streamlit --version` shows

```auto
Streamlit, version 1.23.1

```

---

<div class="post-metadata">

**Author:** ![Goyo](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/goyo/32/28219_2.png) [@Goyo](https://discuss.streamlit.io/u/Goyo)\
**Post date:** [June 28, 2023, 12:09pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/5 "2023-06-28T12:09:31Z")

</div>

You are running pip and streamlit in different environments.

---

<div class="post-metadata">

**Author:** ![jagadeesha\_Gowda](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/jagadeesha_gowda/32/49471_2.png) [@jagadeesha\_Gowda](https://discuss.streamlit.io/u/jagadeesha_Gowda)\
**Post date:** [June 28, 2023, 12:13pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/6 "2023-06-28T12:13:53Z")

</div>

Update the Streamlit version, i am getting same error, once i updated streamlit version its working…version 1.24.0

---

<div class="post-metadata">

**Author:** ![Aryakris17](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Aryakris17](https://discuss.streamlit.io/u/Aryakris17)\
**Post date:** [June 28, 2023, 12:17pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/7 "2023-06-28T12:17:37Z")

</div>

> [@Aryakris17](#):
>
> `pip install --upgrade streamlit`

i’m in the base environment.

---

<div class="post-metadata">

**Author:** ![Goyo](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/goyo/32/28219_2.png) [@Goyo](https://discuss.streamlit.io/u/Goyo)\
**Post date:** [June 28, 2023, 12:19pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/8 "2023-06-28T12:19:52Z")

</div>

Try this:

```shell
python -m pip install streamlit==1.24.0
python -m streamlit --version

```

---

<div class="post-metadata">

**Author:** ![Aryakris17](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Aryakris17](https://discuss.streamlit.io/u/Aryakris17)\
**Post date:** [June 28, 2023, 12:29pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/9 "2023-06-28T12:29:12Z")

</div>

Doing this and then doing

```auto
python -m streamlit run app.py

```

runs the app nicely. Thank you @Goyo ! Could you please tell me why this happens?

---

<div class="post-metadata">

**Author:** ![Goyo](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/goyo/32/28219_2.png) [@Goyo](https://discuss.streamlit.io/u/Goyo)\
**Post date:** [June 28, 2023, 12:48pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/10 "2023-06-28T12:48:55Z")

</div>

Because of different environments. I mean environments in a broad sense. You can have several python virtual environments, conda environments, python versions, etc. and combinations of them.

So `pip` was running in an environment and `streamlit` in a different one, but there is no way I can know the exact reason. By running both commands consecutively with a specific python you make sure you are always using the same environment.

---

<div class="post-metadata">

**Author:** ![Aryakris17](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Aryakris17](https://discuss.streamlit.io/u/Aryakris17)\
**Post date:** [June 28, 2023, 12:54pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/11 "2023-06-28T12:54:35Z")

</div>

Thank you so much @Goyo !

---

<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:** [June 30, 2023, 12:55pm UTC](https://discuss.streamlit.io/t/attributeerror-module-streamlit-has-no-attribute-chat-input/46197/12 "2023-06-30T12:55:06Z")

</div>

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