VSCode isn't finding my file when I try to run streamlit

I’ve installed streamlit and I’m on version 1.31.1 and python is version 3.11.5
I’ve created a python file in VSCode and imported streamlit as st. I tried to run it to see my page but it keeps saying “Error: Invalid value: File does not exist: app.py”

What could I do to fix this?

1 Like

Hi @Neil_McDevitt . What is your file name? For running you should use streamlit run your_file_name.py. Also make sure that both your file and terminal are in same location!!
Happy Streamlit-ing :balloon:

1 Like

my file name is app.py and that’s what im typing in to run it. what do you mean by file and terminal being in the same location?

Thnakss for your help

1 Like

@Neil_McDevitt . For example in your system you are in

Downloads
   -- other folders
   --  your streamlit application folder
         -- other files
         --  app.py

Then your terminal should be in your streamlit application folder for running the streamlit run app.py.

Hope you understand.

1 Like

OR you can run the whole file path in the terminal, such as
streamlit run C:\Users\your username\Desktop\your streamlit application folder\app.py

1 Like