When you use an IDE debugger with this code, it can’t get a Session ID from the IDE itself, so you get this message:
" session_id = get_report_ctx().session_id
AttributeError: ‘NoneType’ object has no attribute ‘session_id’
"
I understand why we get this error, but what is the solution? How do we debug our code using the debugger when our local IDE can’t generate a sesion_id?
Hello @euler, if you have some data that must be cleared every run, the best way to do it is to keep them out of the session state I guess. Could you describe more precisely your usecase?
Hello @ksxx, unfortunately it’s not possible to change widget values programmatically for now. This session state doesn’t support it, and I don’t know any that does.
If you’re still encountering this issue,you could maybe use @thiago’s SessionState which does not use any hashing mechanism. My implementation is mostly useful if you want to bind widget values to session state variables.
I tried to set the page config but an error came out stated that I can only call it once. I suspect it’s probably due to how multiple app structure calling it. Is there any hack around this? @okld
StreamlitAPIException : set_page_config() can only be called once per app, and must be called as the first Streamlit command in your script.
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.