Unable to understand the reason for error

image

switch_page : 🖱️ Switch page function - streamlit-extras
on using the switch_page(“faceauthentication”) present in widgets.py
i am getting this error: Could not find page faceauthentication. Must be one of [‘app’]
how do i resolve this?

code for ‘faceauthentication.py’:

import numpy as np 
import streamlit as st
from .utils import register_new_usr

st.set_page_config(
    page_name="faceauthentication",
)

def start():
    arr = st.session_state.cur_usr
    st.title("Welcome " + arr['name'])
    # 0 for webcam feed ; add "path to file" 
    # for detection in video file 
    st.write("Add Face for Authentication")
    #st.markdown('1. Press esc to exit \n 2. Press Space when face is ready to be captured')
    result = False
    #stuff`Preformatted text`

    if result:
          img_vector = np.array([-1])
          register_new_usr(arr['name'],arr['email'],arr['username'],arr['password'],img_vector)
    else:
        st.error('User already exists in the DB indedtity theft is a crime', icon="🚨")

start()```

Hi @rojox74767

To use switch_page it seems you may need to make your Streamlit app a multi-page, please structure your app like the one should here: GitHub - dataprofessor/multipage-app-starter-kit

Notice that the main page is 🏠_Home.py while the other pages in your app should be in a folder called pages then inside this pages folder you can have several other pages such as your faceauthentication.py page.

Finally, you can use switch_page("faceauthentication").