报错:line 6, in from streamlit.cli import main ModuleNotFoundError: No module named 'streamlit.cli

在anaconda 中安装 streamlit 版本是 1.16.0,但在运行时发生报错:
line 6, in from streamlit.cli import main ModuleNotFoundError: No module named 'streamlit.cli

解决办法是,找到安装环境中的streamlit文件,打开,找到第6行,将 from streamlit.cli import main,改为from streamlit.web.cli import main 即可

在终端输入:streamlit hello

在结果中呈现下面内容,那么就成功了

👋 Welcome to Streamlit!

If you’d like to receive helpful onboarding emails, news, offers, promotions,
and the occasional swag, please enter your email address below. Otherwise,
leave this field blank.

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐