Mapbox Token and config.toml file

Hello Everyone,

I set my Mapbox token Users/.streamlit/config.toml as instructed on one of these discussions.
token = “Mapbox-Token”

When I don’t have this file, the PyDeck example for San Francisco looks fine (it is not interactive, but it does render in a browser window). However, when I have this token in the config.toml file, then I have an interesting error:

Traceback (most recent call last):
  File "C:\Users\StevenJBark\Anaconda3\Scripts\streamlit-script.py", line 5, in <module>
    from streamlit.cli import main
  File "C:\Users\StevenJBark\Anaconda3\lib\site-packages\streamlit\__init__.py", line 76, in <module>
    from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator
  File "C:\Users\StevenJBark\Anaconda3\lib\site-packages\streamlit\delta_generator.py", line 18, in <module>
    from streamlit import caching
  File "C:\Users\StevenJBark\Anaconda3\lib\site-packages\streamlit\caching.py", line 40, in <module>
    from streamlit.hashing import Context
  File "C:\Users\StevenJBark\Anaconda3\lib\site-packages\streamlit\hashing.py", line 39, in <module>
    from streamlit.folder_black_list import FolderBlackList
  File "C:\Users\StevenJBark\Anaconda3\lib\site-packages\streamlit\folder_black_list.py", line 39, in <module>
    if config.get_option("global.developmentMode"):
  File "C:\Users\StevenJBark\Anaconda3\lib\site-packages\streamlit\config.py", line 86, in get_option
    parse_config_file()
  File "C:\Users\StevenJBark\Anaconda3\lib\site-packages\streamlit\config.py", line 994, in parse_config_file
    _update_config_with_toml(file_contents, filename)
  File "C:\Users\StevenJBark\Anaconda3\lib\site-packages\streamlit\config.py", line 913, in _update_config_with_toml
    for name, value in options.items():
AttributeError: 'str' object has no attribute 'items'

I looked at the config.py file at line 313 and I suspect there is an issue with the token reading as a string versus what is required for .items. Any ideas about how to configure my Mapbox key?

Best, Steve

Hi @stevenjbark, welcome to the Streamlit community!

Can you provide a code sample for us to run (don’t need the Mapbox token), as well as let us know what OS, browser and version of Streamlit you are running?

Best,
Randy