-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page Config (page_title) #56
Comments
interested in this too. very frustrating issue! |
I've tried this example myself with streamlit=1.29 and it works. The only thing I've changed from your example is In general - streamlit lets you choose the page_config once. You should only put it in the main script you are running. If you add it more than once (regardless of this component) it will throw the error above. I think this issue can be closed but I'll let you reply, if you think it is still related to the component and not to how you run your streamlit app |
I guess that's the point the component is defining the page_config, which makes it, so I am unable to do so. |
@gclark01 - Ok sorry, now I see what you mean. Indeed in the init we have a config. @gclark01 - Can you give me a reproducable example where it fails? Even though I know it is not the best practice, for me in version 1.29 it doesn't fail with the code above (with the minor change I had to make, but I'm just wondering if something is happening there) Please supply any relevant information so I can reproduce and see what is going on. |
if you run this function and st.config at same time you will reproduce it. |
As I mentioned, I ran the code above, which contains the st.config but it didn't reproduce. |
Very odd... I just fired up the app where I was testing this and with streamlit version 1.29 it appears to be working. No code changes. If I can find sometime today, I will build a new app with this module to make sure I didn't miss something. As of now it seems to be working. |
I forked, cloned and committed an edit fixing it but to my (limited knowledge) I believe that would just impact me. |
I got the same issue where I call set_page_config on the main page. The module seems to be calling the same function in:
The reason I call set_page_config in my main function is because layout=wide in the module does not take effect for some reason. Below screenshot shows my codebase and error message goes away when I comment out line 303 or remove 290-293 Potential cause:
|
Just noticed a different behaviour. So I swapped the order of statements. Initially option_menu call was the first statement in my script and resulted into that issue. I placed line 303 above line 290 and the error message went away |
I figure I must be doing something wrong here.
I am getting this error...
StreamlitAPIException: set_page_config() can only be called once per app page, and must be called as the first Streamlit command in your script.
It seems to be coming from this module in
__init__.py
where it is setting page_title.If I comment out this line
st.set_page_config(page_title="Option Menu", layout="wide")
- then I no longer receive the error and I am able to add my own page title.Is there a way to work around this or please help me understand what I am doing wrong.
The text was updated successfully, but these errors were encountered: