"streamlit hello" -- TypeError: Protocols cannot be instantiated

Hi There, I’m running a vanilla version of python through anaconda and installed the latest version of Streamlit using the command pip install streamlit in my conda cmd terminal. It successfully installs streamlit version 1.12.0

As a sanity check, when I follow up with streamlit hello - the localhost server shows up and streamlit it opened, however it is stuck on “Please wait…”

When I look at my terminal, I see a loop for TypeError: Protocols cannot be instantiated. Is there any resolution to this?

1 Like

Hi @Patrick_B, welcome to the Streamlit Community! :wave: :partying_face:

This is actually a bug with Python 3.9.7 that we weren’t previously running into because we weren’t using typing.Protocol until streamlit 1.12.0.
Please see the discussion in #5140 for more information. I would recommend upgrading your Python version to any version later than 3.9.7 to fix this.

3 Likes

@snehankekre Thank you for the help! I upgraded my python version to 3.9.12 using

conda update python

FYI just wanted to point out that if I search something similar on google, it will direct the user to a solution that recommends downgrading streamlit to a previous version. Hopefully some SEO can be done to highlight this solution instead.

1 Like

Really good suggestion, @Patrick_B! Perhaps we could add a small knowledge base article in the docs, such that the error message is the article title and the solution is the rest of the content. It should get picked up for SEO fairly quickly.

1 Like

Error is because of the incompatibility version of python and streamlit. Updating python to 3.10.6 and streamlit>=1.12.0 will resolve the error.

mine is still not working please help

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