Streamlit App Running, But Browser Shows Blank Screen (VS Code)

I recently installed Visual Studio Code (VS Code) and set up Streamlit. When I run my app with:
streamlit run app.py
The terminal says everything runs fine, and the browser opens at localhost:8501, but the webpage stays completely blank — no content or errors appear.
Here’s what I’ve tried so far:

  1. Reinstalled Streamlit (pip uninstall streamlitpip install streamlit).
  2. Cleared Streamlit cache (streamlit cache clear).
  3. Verified no errors show in the terminal or browser console.
  4. Tried running a basic script like:
    import streamlit as st
    st.title(“Hello, Streamlit!”)
    st.write(“If you can see this, Streamlit works :tada:”)
    Still, nothing appears in the browser.
  5. Opened in different browsers (Chrome, Edge, Incognito mode).
  6. Checked Streamlit’s config (streamlit config show) — the server is running on localhost:8501 without issues.
  7. Ensured the Python extension in VS Code is installed and working.
  8. And everything is working Fine in Pycharm
    I completely uninstalled and reinstalled VS Code and Streamlit — but the problem persists.

System info:

  • Windows 10/11 (mention your OS version)
  • Python version (python --version)
  • Streamlit version (streamlit --version)
  • VS Code version

Does anyone have a fix or has faced this before? Would appreciate any help! :folded_hands:

Two things come to mind:

  1. Double check that the file has been saved with the changes.
  2. Double check you are running the file you think you are. (especially if you have another file of the same name in another directory)

When you see the blank screen, does that include the app menu in the upper-right corner? Is it just the page contents that are missing, or is the app menu missing, too?

Hey
I have double check everything and
I have also tried though different laptop then streamlit is working fine but un my laptop doesnt work and the other think is if i tried though Pycharm then streamlit working fine
also i have tried streamlit Hello on terminal that is working fine but when i tried my working file it doesn’t work browser open and screen is blank

When you say the screen is blank, does that include the app menu in the upper right corner, or do you just mean the body of the page? (If you can see the menu then Streamlit might be running a different file, one without Streamlit commands saved in it.)

I’m not sure what to suggest. If it runs from one terminal in Pycharm, but not a different terminal, I can only guess that there is some mix up with an environment, your PATH, or directory location. However, it’s really difficult to diagnose that from here. :disappointed_face:

can you share app.py file or the file.py which used “streamlit run file.py”