简体   繁体   中英

Streamlit - Protocols cannot be instantiated

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.

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM