What you need before you start

Streamlit is a Python library that turns data scripts into interactive web apps without requiring HTML, CSS, or JavaScript knowledge. To install it on Windows, you need Python 3.8 or newer already installed on your machine. If you do not have Python yet, download it from python.org and run the installer — make sure to check the box that says "Add Python to PATH" during installation, as this lets you run Python from the command line.

You will also need a command-line tool to enter installation commands. Windows comes with Command Prompt built in, though many developers prefer PowerShell or Windows Terminal (which you can download free from the Microsoft Store). Either one works fine for this process.

Key Takeaways

  • Python 3.8 or newer must be installed first, with the "Add Python to PATH" option checked during setup.
  • Open Command Prompt or PowerShell and run pip install streamlit to download and install the library.
  • Verify the installation worked by running streamlit hello, which opens a demo app in your browser.
  • Create a Python file with a .py extension, write your Streamlit code, then run it with streamlit run filename.py.

Installing Streamlit using pip

The easiest way to install Streamlit on Windows is through pip, which is Python's package manager and comes automatically when you install Python. Open Command Prompt by pressing the Windows key, typing "cmd", and pressing Enter. You can also open PowerShell the same way by typing "powershell".

In the command window, type the following and press Enter:

pip install streamlit

Pip will download Streamlit and all the libraries it depends on, which may take a minute or two depending on your internet speed. You will see text scrolling past as files download and install. When it finishes, you should see a line that says "Successfully installed streamlit" followed by a version number.

Checking that Streamlit installed correctly

After installation finishes, verify that Streamlit is working by running the built-in demo app. In the same command window, type:

streamlit hello

Press Enter. Streamlit will start a local web server and automatically open your default browser to a page showing the demo app. You should see a colorful interface with interactive elements like sliders and buttons. This confirms that Streamlit installed successfully and can run on your machine.

Close the browser tab when you are done exploring. To stop the Streamlit server, go back to the command window and press Ctrl+C, then type "y" and press Enter when prompted.

Creating and running your first Streamlit app

Now that Streamlit is installed, create a simple app to test it. Open a text editor (Notepad works, though many developers prefer Visual Studio Code or another code editor) and type the following code:

import streamlit as stst.title("My First App")st.write("Hello, this is my Streamlit app!")name = st.text_input("What is your name?")if name:    st.write(f"Nice to meet you, {name}!")

Save this file with a .py extension — for example, "app.py" — in a folder you can easily find, like your Documents folder or Desktop. Do not save it as a .txt file; the .py extension is important.

Open Command Prompt or PowerShell again and navigate to the folder where you saved your file. If you saved it on your Desktop, you can type:

cd Desktop

Then run your app by typing:

streamlit run app.py

Your browser will open and display your interactive app. Try typing your name in the text box to see the app respond. This simple example shows how Streamlit turns Python code into a working web interface.

Troubleshooting common installation issues

If you see an error saying "pip is not recognized as an internal or external command", Python was not added to your PATH during installation. Reinstall Python, and this time make sure to check "Add Python to PATH" before clicking Install.

If you see "streamlit: The term 'streamlit' is not recognized", close your command window completely and open a new one. Windows sometimes needs a restart of the command prompt to recognize newly installed programs. If that does not work, try running python -m streamlit hello instead of just streamlit hello.

If Streamlit starts but your browser does not open automatically, look in the command window for a line that says "You can now view Streamlit app in your browser" followed by a web address like "http://localhost:8501". Copy that address and paste it into your browser's address bar manually.

Using virtual environments (optional but recommended)

As you build more Python projects, you may want to use virtual environments — isolated folders where each project has its own set of installed libraries. This prevents different projects from conflicting with each other. To create a virtual environment on Windows, open Command Prompt in the folder where you want to work and type:

python -m venv streamlit_env

Then activate it by typing:

streamlit_env\Scripts\activate

You should see the name "streamlit_env" appear in parentheses at the start of your command line. Now when you run pip install streamlit, it installs only into this folder, keeping your main Python installation clean. This is not required to use Streamlit, but it becomes useful as your projects grow.

Next steps after installation

Now that Streamlit is running, explore the official documentation at docs.streamlit.io to learn what functions are available. The most common ones are st.write() for displaying text and data, st.slider() for interactive controls, and st.dataframe() for displaying tables. Start by modifying the example app above — change the title, add more text input fields, or add a slider to see how Streamlit responds.

When you are ready to share your app with others, Streamlit Cloud (streamlit.io/cloud) lets you host your app for free if your code is in a public GitHub repository. For now, focus on building locally and learning the library's core features.

Frequently Asked Questions

Do I need to install anything else besides Python and Streamlit?

No. Streamlit includes everything you need to build and run basic apps. As your projects grow, you may want to add other libraries like pandas for data analysis or numpy for numerical computing, but you can install those later with pip when you need them.

What Python version should I use?

Streamlit supports Python 3.8 and newer. If you have an older version installed, download a newer one from python.org. You can have multiple Python versions on the same machine — just make sure the newer one is added to your PATH.

Can I use an IDE like Visual Studio Code instead of Command Prompt?

Yes. Most code editors have a built-in terminal where you can run the same commands. In Visual Studio Code, press Ctrl+` to open the terminal, then run streamlit run app.py the same way you would in Command Prompt.

Why does my app refresh every time I save the file?

That is Streamlit's default behavior — it reruns your entire script whenever you save changes. This lets you see updates instantly, but it means any data you create in memory gets reset. For more control over when code runs, use Streamlit's caching features, which you can read about in the documentation.

What if I want to uninstall Streamlit later?

Open Command Prompt and type pip uninstall streamlit, then type "y" when prompted. This removes Streamlit but leaves Python and other libraries intact. If you used a virtual environment, you can simply delete the folder instead.