Set page config error on loading app or returning to main that disappears on refresh

So this has only started appearing since 1) I upgraded streamlit to the lastest version and 2) I added some more complexity to one of my scripts.
I thought maybe my old way of indicating page configuration was outdated, so I updated it to match the example in the docs, but that didn’t fix it.
The page config is only mentioned once in my code (I double checked) and it’s the first non-import line in the main script. I don’t know why this is showing up
 but it’s really annoying. I have to do a preso next week and this is really going to look bad.



The code is on my machine locally - I don’t want to upload it in case it’s somehow going to trigger a version change so that it impacts my publicly shared app.

Hey @tyrin,

If you’re sure you have one occurence of st.set_page_config, maybe that line is executed twice.
Can you use a debugger and place a breakpoint on that line to check if it is called twice?
Do you import your app.py in another script that is run as well?

So, when I run " run streamlit app.py" the error is the first thing that appears in the browser. When I press the browser refresh buttton it disappears. But it reappears everytime I select the option that returns the app to the main method in app.py. I commented it out and the error disappeared.
Nothing I have calls app.py directly. But app.py does have
app_mode = st.sidebar.selectbox(“Check your content for:”,
[’”:
home()
where home just doesn’t call a module (i.e. returning it to app.py home screen.)
I come from a perl background, so I’m used to working without a net (a debugger). I’ll lookup how I’m supposed to do that with streamlit. But it might take me a minute.
Also - it wasn’t even in the main method, so I don’t see how it could have been called twice.

(Update) Yeah
the debugger feels like a rabbit hole and I’ve still got a bunch to do before the preso, so I’m gonna sleep on that for now. It’s annoying, because it used to work and I prefer the wide layout, but oh well.

Maybe try to comment as much code and imports as possible, to strip down your app to the minimum until it doesn’t show the error. If the minimal code of import streamlit as st and st.set_page_config(...) triggers the error, then it must be related to your execution environment somehow.

Could you perhaps share your app (or at least a minimal sample that triggers the error) to check if we can reproduce the issue?

Hi, im having the same problem
this is my code: GitHub - angelicaba23/app-super-resolution at dev

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.