5

I just installed the streamlit package. When I try to run 'streamlit hello' I get the following error:

(base) C:\>streamlit hello Traceback (most recent call last): 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\runpy.py", 
  line 193, in _run_module_as_main "__main__", mod_spec) 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\runpy.py", 
  line 85, in _run_code exec(code, run_globals) 
File "C:\Users\s158539\AppData\Local\Continuum\anaconda3\Scripts\streamlit.exe\__main__.py", 
  line 5, in <module> 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\__init__.py", 
  line 121, in <module> from streamlit.DeltaGenerator import DeltaGenerator as _DeltaGenerator 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\DeltaGenerator.py", 
  line 33, in <module> from streamlit import caching 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\caching.py", 
  line 38, in <module> from streamlit.hashing import CodeHasher 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\hashing.py", 
  line 36, in <module> from streamlit.folder_black_list import FolderBlackList 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\folder_black_list.py", 
  line 39, in <module> if config.get_option("global.developmentMode"): 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\config.py", 
  line 94, in get_option parse_config_file() 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\config.py", 
  line 877, in parse_config_file _update_config_with_toml(file_contents, filename) 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\config.py", 
  line 799, in _update_config_with_toml parsed_config_file = toml.loads(raw_toml) 
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\toml\decoder.py", 
  line 379, in loads original, pos) toml.decoder.TomlDecodeError: Key group not on a line by itself. (line 1 column 1 char 

Does anyone know how to solve this error?

Thank you in advance!

LhasaDad
  • 1,786
  • 1
  • 12
  • 19
Jepetto
  • 51
  • 1
  • 1
  • 2
  • 1
    Seems like its uphappy with your config file, did you edit it? if you did it most likely is something about how it was edited. could you edit your entry to include the contents of the config toml based file. – LhasaDad Jan 19 '20 at 15:33
  • there is a toml validator here: https://www.toml-lint.com/ Try feeding it the contents of your config file. – LhasaDad Jan 19 '20 at 15:34
  • I have the same error. How do I find the config toml based file? – bjornvandijkman Jan 21 '20 at 10:53

6 Answers6

4

I also got the same error while I tried to run the 'streamlit' command.

So, what I did is track in the code entirely to see from where I can find this 'config.toml' and simply deleted the file.

The path for 'config.toml' file in Windows is: C:users/{username}/.streamlit/config.toml

Delete this file and it will solve the error.

Andreus
  • 2,437
  • 14
  • 22
Dinesh rao
  • 131
  • 1
  • 2
3

Just delete the config.toml file which can be found in the directory where you have installed streamlit.

Dharman
  • 30,962
  • 25
  • 85
  • 135
2

If you are not able to locate your .streamlit directory

Run streamlit cache clear

Output :

Nothing to clear at {Username}\{path}\.streamlit\cache.

You will get output similar to this which will tell you where is your .streamlit directory exactly.

Take this path before the cache part

cd {Username}\{path}\.streamlit

You'll be able to see config.toml here just delete that file.

Vidhi Gupta
  • 21
  • 1
  • 3
1

The Streamlit forum has this discussion topic: https://discuss.streamlit.io/t/toml-docoder-error/1400/10 that discusses this. Hope this helps!

user62241
  • 144
  • 1
1

delete the content of config.toml file which is in C:\Users\username.streamlit

0

Do you have a setup.sh file? What's the content inside it? maybe you will just have to put the content of setup.sh everything in 1 line like this

[server]\nheadless = true\nenableCORS=false\nport = \n

my problem was similar, not exactly like this. so I hope it works!

Pimpwhippa
  • 37
  • 8