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.
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?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.