My Stremlit Project is not showing up any result on the page that is opened after running it through Command Prompt

Hello Srtreamlit Community,
I am a newbie to this community and so was unable to debug the issue that I was facing. And the issue is:
I have written some python codes using streamlit in the code editor(Atoms) and when I had run the python file through command prompt a tab was opened but nothing was appearing on the screen. The screen was blank and no error was also showing just a plain screen.
Can you please help me?

Thanks in advance!

#streamlit #python

Can you share your code?

Sure @Ian_Calvert
Please use the link below to look into the code

There’s no call to the main function where you’ve put all your code :slight_smile:

You may want to move the other functions outside of that anyway, I’m not sure how the caching works with dynamically defined functions.

1 Like

Welcome to the community, @Muskaan!

@Ian_Calvert is right that the problem is that your main() function isn’t being called. The typical way to do this is:

if __name__ == "__main__":
  main()

(Btw, @Ian_CalvertL: Streamlit caching should “just work” for dynamically defined functions. The hash key consists of the function’s code as well as all implicit and explicit arguments to the function passed in at runtime.)

Happy app creating! :balloon:

3 Likes

@Ian_Calvert Thankyou so much!
I have done a minute mistake which is indeed a major one in itself! :slight_smile:
Thankyou for helping me out :slight_smile:

1 Like

Thankyou @Adrien_Treuille
I have updated the code :slight_smile:

@Adrien_Treuille
After doing the required corrections. I have a few more errors that hit up. Please help!
The errors are in the section when the type of metrics is called.
Look to the attached snapshot of the error

The same errors are hitting up when the metrics is chosen

Hello @Muskaan,

Apparently, the issue comes from the function call plot_precision_recall_curve() where you pass a kind parameter. At some point in the plotting, it encounters a Line2D to which it tries to pass kind, which is not a valid parameter.

You haven’t updated your github code yet, so I can’t investigate this error further more.

It may not solve your problem, but I found this StackOverflow post with the same exception as yours.

1 Like

@okld ,I have checked the same issue on stackoverflow but couldn’t resolve it. Also, I have updated the code in my github account. Kindly check.

I am having the same issue please. I am calling my main() function, but the browser tab is just blank. please i need help.
here is my code: Learning-Streamlit/DEPLOYMENT.ipynb at master · AnefuIII/Learning-Streamlit · GitHub