Hi I’m new to coding and have just read about stremlit which seems awesome, I have been able to launch the streamlit hello app for the demos successfully, but when I try to launch my own, I get the following error:
Usage: streamlit run [OPTIONS] TARGET [ARGS]…
Error : Invalid value : File does not exist : app.py
I know it might be a trivial question for all the advanced people here, but I would appreciate the help so I can start my exploration.
Well you got the demo working, which is great ! Now for your case, if you are running streamlit run app.py, Streamlit will you look for a file app.py in the folder the terminal is running in, and from the error File does not exist: app.py it seems it could not find the file.
Don’t forget to create such a file in the folder where your terminal is running . On Windows the folder you are in should be written the line before, on Unix, you can type pwd to see the folder it’s in.
If you managed to create your script app.py, you should see the file in the terminal using the dir command in Windows/ls command in Unix in the list of files in your terminal.
Then for example you can write the following code in the app.py file, using Notepad++ or Notepad :
import streamlit as st
st.header("Hello world !")
st.balloons()
and hopefully Streamlit will pop out and cheer you with balloons when you run the command.
We can help you a bit more if you specify on which OS you are running, if you are using Anaconda Navigator to manage your packages, and how you installed Streamlit, so don’t hesitate to provide us more information about your setup.
Hello I am facing the same error. I converted Jupyter file “.ipynb” to “.py” file. This “.py” file is in Desktop and is able to read by Windows command of “dir”.
But when i try to run this file using streamlit run , this throws an error of file not found.
Can you please help on this?.
Hello. I ran into the same error. it works fine on my window 10 locally. When I tried it on cloud window server 2019 with vscode terminal.
I was able to get through using from command prompt and navigate into the folder of the .py
The app.py is a text file. You can use a text editor like Notepad++ or an IDE like VsCode to create a new text file with the .py extension to make it a python file.
Put the Streamlit code in the file, then with a command line, activate the Python environment which contains the Streamlit package, move to the folder with the Streamlit script and run streamlit run app.py
had the same issue , first, we have to run the programme then it displays Warning: to view this Streamlit app on a browser, run it with the following
command:
copy and paste the command.