In Streamlit Pages, importing python package clarity required

Hi Team,

currently i am importing python packages in all pages including home page. Is it correct or wrong?

example:
In Home.py file

from ssl import SSL_ERROR_SSL
import streamlit as st
import pandas as pd
import os
import altair as alt
from st_aggrid import GridOptionsBuilder, AgGrid, GridUpdateMode, DataReturnMode
import plotly.express as px

and in pages/content.py file

from ssl import SSL_ERROR_SSL
import streamlit as st
import pandas as pd
import os
import altair as alt
from st_aggrid import GridOptionsBuilder, AgGrid, GridUpdateMode, DataReturnMode
import plotly.express as px

kindly advise

Pages share modules globally: Creating multipage apps using the `pages/` directory - Streamlit Docs

Once the modules have been imported to any page, they don’t need to be reimported in other pages.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.