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.
Answers:
I updated my python version to 3.10, which solved the issue. Apparently 3.9.7 causes this issue.
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
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.
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.
I updated my python version to 3.10, which solved the issue. Apparently 3.9.7 causes this issue.
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
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.