Yes, I am getting this set_page_config error also. I am using the pages folder to define my multi-page app. The main page provides links to the individual sub-pages, via st.markdown, as they have their own url. The sub-pages have set_page_config as the 1st streamlit command to change the title etc. This worked well in 1.16, but it causes trouble in 1.18.1.
Since each page has its own url, I think the behavior of 1.16 should be the preferred behavior. The strange thing is, the error would go away if I reload the sub-pages. It feels like there has been a regression.
Just tried to upgrade my app from 1.17.0 to 1.18.1. Upgraded from @st.cache to @st.cache_data. But something seems off. I am now getting a streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError: Key not found in mem cache error.
I have not noticed a change between 1.17 and 1.18 in my code, so it might be something completely different. But one way in which this error unexpectedly came up for me before is by importing anything with the cache decorator before st.page_config… just a hint.
Thanks for the suggestion, ennui, but I don’t think the situation you mentioned is happening because the same code works fine under 1.16 (and 1.17 as well… I’ve just tested it).
Hi all… I think I’ve identified the problem with set_page_config. The issue comes up because of the warning about st.experimental_memo being deprecated. This warning is probably the 1st streamlit command, thus triggering the error.
I’ll report back once I’ve gotten rid of all st.experimental_memo in my production code, but in a test setup, moving to st.cache_data solved the issue.
Edit: Yes, that was the issue. Replacing all the experimental_memo/experimental_singleton solved it.
I am using 1.18.1 and st.cache_data is giving an error.
I used to use st.cache and worked well.
I guess the problem is that I am using st.cache in a class method:
class Dal:
@st.cache_data
def get_tables(self) -> list[str]:
return requests.get(self.config.api_host + 'data-lake/tables').json()
class App:
def __init__(self, dal):
self.dal = dal
def run(self):
tables = self.dal.get_tables()
I use some helper function in all the pages, calling set_page_config only when st.session_setting["initialized"] is false. Not the most convenient way to do it but it is not too bad.
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.