How to use streamlit in Repl.it
Streamlit is a python library for creating a quick frontend really fast : https://streamlit.io/
However to run it you need to access terminal and run this command for example :
streamlit run myapp.py
I could get around this by calling the command using
subprocess in the main.py, but the app is not accessible from the link provided by repl.it.
Did anyone succeed running streamlit on replit ? Any advice would be helpful.
Hey @NicolasRemond 👋.
I've recently used streamlit in replit and I think you can follow the same steps given below :
Create a new repl with Python
Write your streamlit code in
main.pyand then rename the file to
Create a new file called,
requirements.txt, & add the streamlit latest version and other packages versions you have used in your
Configure the run command inside
run = "streamlit_app.py"
Now, go to Shell area and write --->
$ pip install streamlit
[After some minutes streamlit will be installed!]
[Then check whether streamlit was installed by running the command below]
$ streamlit hello
Finally, run ---> $ streamlit run streamlit_app.py
[This will open a Mozilla browser running your streamlit App! 🎉🎈]
If you found these steps helpful for you, then make sure you upvote and share it! 😃
You can still run shell commands in Repl. So you can use
subprocess to get the result you are looking for. You can move the code you have in
main.py to a new file, and then use the
main.py file to run the commands which will run streamlit`.