How to Run Streamlit App? VS Code Studio, Jupyter Notebook

Streamlit is an open-source tool that is used for Python dashboards and web applications. When you are done with the coding part, it is now time to run your Streamlit App. In this short article, we will discuss how to run the Streamlit app in various editors including VS Code, Jupyter Notebook, and Google Colab. In general, the streamlit run [] is used to run the web app.

How to Run Streamlit App?

Well, the process is very simple. All you need is to open the terminal and type streamlit run [] and it will open the application in the default web browser on your PC.

Let us say that we have a Streamlit application in a file name Then, we can follow the given steps to run the streamlit app in vs code

  1. Open the file in VS Code
  2. Open a new terminal in VS Code
  3. Type “streamlit run’, and hit enter
  4. The app will run on the local host and a new web browser will open
  5. Congratulations on running the app successfully.

How to Run Streamlit App in Jupyter Notebook or Colab?

Well, It is not possible to run the Streamlit app inside a Jupyter Notebook. There can be several reasons for it. One of the common reasons is that the Streamlit app starts a server on the main thread which means if we run it inside Jupyter Notebook then the kernel of Jupyter Notebook will be closed and we will not be able to use it anymore.

Example of Running Streamlit App in VS Code

Now, you are familiar with the running of the app in a web browser. Let us go through a simple example and see how to run the Streamlit app in VS Code.

First, let us import the required modules.

import streamlit as st

Now, we will write the script for our Streamlit app. Here for the sake of understanding, we will just type the title of the web app and then we will run it.

st.title("Example Web Application")

Now, open the terminal and type the given commands. In our case, the name of our Python file is so we will use it.

streamlit run

Now, a new tab will open in the web browser showing you the web application.

how to run streamlit app in vs code

Congratulations on successfully running the web application.


Streamlit is a new and cool Python module that made the web application so simple. Now, we can create interactive dashboards and web apps using a few lines of code. In this short article, we discussed how we can run the Streamlit app on VS code studio using the terminal.

Articles Related To Steamlit

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top