Streamlit – Protocols cannot be instantiated

Question:

I tried running a simple

import streamlit as st

st.write('Hello World')

It returns a TypeError: Protocols cannot be instantiated. Found a similar post mentioning installing a prior version, which resulted in the same error. The local app does launch, but sits on "Please wait…" screen.

Asked By: SomeActuary

||

Answers:

I updated my python version to 3.10, which solved the issue. Apparently 3.9.7 causes this issue.

Answered By: SomeActuary

This is actually a bug with Python 3.9.7 that developers weren’t previously running into because they weren’t using typing.Protocol until streamlit 1.12.0. You should update your python version

Answered By: Yashwant Devatwal

try this "pip install –upgrade streamlit==1.0.0" Because sometime streamlit current version is not supported with your python version so degrade its version.

Answered By: Kapil Sehrawat
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.