Cannot find my main file when I tried to deploy

I have check many similar posts in community but none of them helpful.

My main file is called home_page.py which is under the src folder. Here is my repo structure:

I have no idea why it cannot find this file. Any advice would be grateful!

Hi @Tu-Zhenzhao . Once try

src/pages/home_page.py

@Guna_Sekhar_Venkata

Thanks for the advice, but unfortunately I am pretty sure home_page.py is under src not pages

Another info might help is I tried other’s repo that main file also located in subfolder also does not work to me. That is very wired. And for sure the test.py and auto_chatbot_csv.py can be found.

Can you share a link to your repo? Have you double checked the you’ve pushed the local file to your online repository?

@mathcatsand

I cannot share the original repo right now there are some API has not been saved into env. But I create another example just like my repo which also does not work repo

I just filed a similar bug on this. If you look at dev tools, you can see it’s returning HTTP 400 (bad request) on the call to validate the file.

I’ve reported this to the engineering team.

Maybe your current working directory needs to be different? Also try putting a simple little test file in each folder and see which one streamlit can find.

Do we have any lead on this cause I have the same problem where I cannot import main file path.

I am facing a similar issue, trying to run the src/app.py but I get a

“This file does not exist”

indeed when looking a dev tool I am getting a 404 on the request: “/api/v2/github/LouisonR/assurbotv2/validate-file-exists/src%2Fapp.py”

Strange this was working properly last week.

Hey @Tu-Zhenzhao @Vedant @Louison, unfortunately there was a bug on Streamlit Cloud which did not allowed to deploy apps from nested main scripts, the bug has been resolved and you should be able to deploy your app

2 Likes

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