Skip to content
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

Cannot use st.set_page_config #4

Open
mirfan899 opened this issue May 28, 2022 · 0 comments
Open

Cannot use st.set_page_config #4

mirfan899 opened this issue May 28, 2022 · 0 comments

Comments

@mirfan899
Copy link

cannot use set_page_config in multiapp. Throws following error.

from mapp import MultiApp
import app1
import app2
import streamlit as st
st.set_page_config(
    page_title="The Entities Swissknife",
    page_icon="https://cdn.shortpixel.ai/spai/q_lossy+ret_img+to_auto/https://studiomakoto.it/wp-content/uploads/2021/08/cropped-favicon-16x16-1-192x192.png",
    menu_items={
        "Get help": None,
        "Report a bug": None,
        "About": None
    }
)
app = MultiApp()
app.add_app("Foo", app1.app)
app.add_app("Bar", app2.app)
app.run()

This is my code where I'm using set_page_config method.

streamlit run app.py 

  You can now view your Streamlit app in your browser.

  Local URL: http://localhost:8501
  Network URL: http://192.168.0.169:8501

2022-05-28 17:59:52.788 Traceback (most recent call last):
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_runner.py", line 475, in _run_script
    exec(code, module.__dict__)
  File "/home/irfan/PycharmProjects/TES-Search/app.py", line 16, in <module>
    "About": None
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/commands/page_config.py", line 145, in set_page_config
    ctx.enqueue(msg)
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_run_context.py", line 74, in enqueue
    + "(https://docs.streamlit.io/library/api-reference/utilities/st.set_page_config)."
streamlit.errors.StreamlitAPIException: `set_page_config()` can only be called once per app, and must be called as the first Streamlit command in your script.

For more information refer to the [docs](https://docs.streamlit.io/library/api-reference/utilities/st.set_page_config).

2022-05-28 17:59:53.693 Traceback (most recent call last):
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_runner.py", line 475, in _run_script
    exec(code, module.__dict__)
  File "/home/irfan/PycharmProjects/TES-Search/app.py", line 16, in <module>
    "About": None
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/commands/page_config.py", line 145, in set_page_config
    ctx.enqueue(msg)
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_run_context.py", line 74, in enqueue
    + "(https://docs.streamlit.io/library/api-reference/utilities/st.set_page_config)."
streamlit.errors.StreamlitAPIException: `set_page_config()` can only be called once per app, and must be called as the first Streamlit command in your script.

For more information refer to the [docs](https://docs.streamlit.io/library/api-reference/utilities/st.set_page_config).

2022-05-28 17:59:58.637 Traceback (most recent call last):
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_runner.py", line 475, in _run_script
    exec(code, module.__dict__)
  File "/home/irfan/PycharmProjects/TES-Search/app.py", line 16, in <module>
    "About": None
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/commands/page_config.py", line 145, in set_page_config
    ctx.enqueue(msg)
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_run_context.py", line 74, in enqueue
    + "(https://docs.streamlit.io/library/api-reference/utilities/st.set_page_config)."
streamlit.errors.StreamlitAPIException: `set_page_config()` can only be called once per app, and must be called as the first Streamlit command in your script.

For more information refer to the [docs](https://docs.streamlit.io/library/api-reference/utilities/st.set_page_config).

2022-05-28 17:59:59.689 Traceback (most recent call last):
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_runner.py", line 475, in _run_script
    exec(code, module.__dict__)
  File "/home/irfan/PycharmProjects/TES-Search/app.py", line 16, in <module>
    "About": None
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/commands/page_config.py", line 145, in set_page_config
    ctx.enqueue(msg)
  File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_run_context.py", line 74, in enqueue
    + "(https://docs.streamlit.io/library/api-reference/utilities/st.set_page_config)."
streamlit.errors.StreamlitAPIException: `set_page_config()` can only be called once per app, and must be called as the first Streamlit command in your script.

For more information refer to the [docs](https://docs.streamlit.io/library/api-reference/utilities/st.set_page_config).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant