You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决调用Streamlit时出现的toml.decoder.TomlDecodeError错误?

Fixing Streamlit's TomlDecodeError When Running streamlit hello

Hey there, let's get this sorted out! That TomlDecodeError you're seeing is all about a broken Streamlit configuration file. Here's what's going on and how to fix it:

What's causing the error?

Streamlit uses a TOML-formatted config file (config.toml) to store its settings, and the error message tells us there's a syntax issue in that file—specifically, a "key group" (like [global] or [server]) isn't on its own line at the very start of the file.

Step-by-step fix:

  1. Locate the config file
    On Windows, your Streamlit config folder is usually at:

    C:\Users\s158539\.streamlit\
    

    Inside this folder, look for the config.toml file.

  2. Fix or replace the config file

    • Open config.toml with a text editor (like Notepad or VS Code). Check the first line—if you see something like [global] some_option = value, split it so the key group is on its own line:
      [global]
      some_option = value
      
    • If the file is empty, corrupted, or you're not sure how to fix it, just delete the config.toml file entirely. Streamlit will automatically use its default settings when you run the command again—no need to create a new one manually.
  3. Test it out
    Run streamlit hello again, and it should launch the demo app without any issues!

内容的提问来源于stack exchange,提问作者Jepetto

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 10:02:40