I am trying to build a multipage dashboard where each page uses functions written in a separate .py files. Title_page.py can read function (called 'add_two()') from func_1.py without any problem. However, Page2.py can't seem to read function (called 'multiply_two()') from func_2.py under p2_functions folder, which is placed inside the pages folder. It throws an error saying:
ModuleNotFoundError: No module named 'p2_functions'
I think it's because streamlit ignore anything other than .py files inside the pages folder, but I don't know how then I could call modules and read functions from other .py files or from other folders.
Here's what I have in the Page2.py:
import streamlit as st
from p2_functions.func_2 import multiply_two
st.markdown("# Page 2 ")
st.write(multiply_two(10 * 20))
Here's the tree of the structure:
├── Title_page.py
├── func_1.py
└── pages
├── Page2.py
└── p2_functions
└── func_2.py