File write error

Hi! I am quite new to streamlit and I am getting permission error while editing the streamlit theme file and a pickle file where I have some news data stored.

check my app from here:
I have a selectbox to select from different themes but it is not working on streamlit-sharing as I do not have permission to edit the toml file.

It works on local system:

Hi @SameerJain901, welcome to the Streamlit community!! :wave: :partying_face:

I’m sorry that you’re running into permission errors on Streamlit sharing. Here’s how you can fix the errors associated with updating your config.toml file and dumping card_data.pkl to disk.


  1. On sharing, all the scripts associated with your app live in the /app/ directory. Pickle can write to this directory

  2. Prepend /app/ to the path of your pickle files by editing line 262 and line 496 of to be

    # line 262
    # line 496


  1. The error is caused by line 141

  2. Either remove line 141 or comment it out

  3. Uncomment lines 142 and 143 such that your update_theme() function looks like the following:

     def update_theme(primaryColor,backgroundColor,secondaryBackgroundColor,textColor,font):
         # Theme Base

Once you make the :point_up: above changes, and Reboot your app, both the errors should be resolved :grinning_face_with_smiling_eyes:

Happy Streamlit-ing! :balloon:

Thanks @snehankekre. It is running smoothly. I did not notice that I was deleting the config file.

1 Like