Toml decoder error (TomlDecodeError)

Getting the following error. Any solutions?
toml.decoder.TomlDecodeError: Key name found without value

Thanks a lot, @eriktuck. Moving the file to another directory solved it for me.

have u found any solution to this problem

I will have to change what?

I’m on windows system and I still couldn’t find the file and solve the problem

so how windows user delay with this problem

Hey I thought my error is also similar to this, so I am including the link of my error:

The contents of my setup.sh file are:

mkdir -p ~/.streamlit/
echo "\
[server]\n\
port = $PORT\n\
enableCORS = false\n\
headless = true\n\
\n\
" > ~/.streamlit/config.toml

My app is running perfectly on local machine. But it is getting the error described in the above link when I try to deploy it on heroku.

If anybody could help me solving this.

just delete config.toml file
it will create again when you run your app.py

rm ~/.streamlit/config.toml
then run your app.py

1 Like

hi
In windows, go to the C:/Windows/Users/%profile name%/.streamlit, delete the toml files and restart streamlit app. it works fine.

1 Like

thanks it worked by removing the toml file

Hey @eriktuck, that was very helpful, what i found additionally is the setup file for heroku deployment has got this entry, which is creating these toml files -

mkdir -p ~/.streamlit/
echo "
[general]\n
email = “your-email@domain.com”\n
" > ~/.streamlit/credentials.toml
echo "
[server]\n
headless = true\n
enableCORS=false\n
port = $PORT\n
" > ~/.streamlit/config.toml

Thank you so much. Deleting the contents of the config.toml file finally resolved the issue.

2 Likes

Thanks a lot @eriktuck , you helped me a lot

1 Like

Wao, Thank you bro, wonderfull !

For those who fail the deployment on Heroku. You might found several tutorials suggesting the setup.sh, but please have a look when you copy-paste the code. I deploy the website without deleting the config.toml file. Here are the steps:

  1. In several tutorials, in the setup.sh, you might see something like this:
mkdir -p ~/.streamlit/
echo "
[general]n
email = "your-email@domain.com"n
" > ~/.streamlit/credentials.toml
echo "
[server]n
headless = truen
enableCORS=falsen
port = $PORTn
" > ~/.streamlit/config.toml

The code creates a .streamlit folder and the config.toml inside the folder. However, your script doesn’t exist in the folder, but at the same level as the folder is. Therefore, Heroku build the app with the default config.toml setting. Therefore, create the folder yourself (in this case .streamlit), putting those .py files and your data inside the folder. Finally, delete the mkdir -p ~/.streamlit/ inside the setup.sh.

  1. The setup.sh and the Procfile are at the same level as the .streamlit folder. In this step, you’ll need to make sure the streamlit run .streamlit/app.py command opens your app, and puts it inside the Procfile.

[Procfile]

web: sh setup.sh && streamlit run .streamlit/app.py

Wrap up:

[setup.sh]

echo "\
[general]\n\
email = \"your-email@domain.com\"\n\
" > ~/.streamlit/credentials.toml
echo "\
[server]\n\
headless = true\n\
enableCORS=false\n\
port = $PORT\n\
" > ~/.streamlit/config.toml

[Procfile]
web: sh setup.sh && streamlit run .streamlit/app.py

Thank you so much.

I’m also facing the same issue

Hi I’m also getting the same error have you resolved the issue?

Hey, i resolved my issue which was quite silly. If you copy the config.toml file from Configuration - Streamlit Docs … some of the quotes reflect as


vs ’

changing all these quotes to ’ or " works!

TomlDecodeError: This float doesn’t have a leading digit (line 1 column 1 char 0)
how to resolve it