Cannot specify working directory for streamlit

Hi all,

I have a project with the following structure:

root/jumping_frog/module.py
root/ui/streamlit_app.py

From the root directory I am typing:

streamlit run ui/streamlit_app.py

and at the top of my streamlit_app.py I have

from jumping_frog.module import JumpingFrog

When I run the streamlit it cannot find the module jumping_frog, which I think is very weird. Can someone help me what I am doing wrong? Basiaclly, I just want root to be the working directory when I launch my streamlit app.

If I’m understanding you correctly, this is just how Python works. The import statements are relative to the file where you are calling them from, except in the case where you add a directory to the PATH.

Have you tried anything like from ../jumping_frog import module or similar?