Deployement error when file is not in main folder

I am trying to deploy my app on streamlit community cloud. I am having trouble understanding how to do it correctly.
My github repository is :

in .streamlit my config.toml has the following:


headless = true
enableCORS = false

serverAddress = "py_code/"

All my code is in py_code folder, with the main file is In py_code I have my where I declared all the functions I am using.
my code structure is as follows:

when deploying the app on streamlit, i had to set it up as follows:

the Main file path i declared py_code/ .
However, when I deploy, I have errors that the module py_code does not exist.
Can anyone steer me in the right direction on how to deploy correctly? Do I need to change my code folder structure?
Many thanks for the help.

Hi @abalgir

I’ve tried deploying an app where the is residing in a sub-folder (please see below screenshot) in a similar way and it worked. However, my .streamlit/config.toml file is left as default set by app-starter-kit. Perhaps you could try again by tweaking the config file, it seems that the serverAddress parameter is not needed for deployment.

Hope this helps!

Many thanks for the sample and explanation. i will test it this afternoon.

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