Install Streamlit

  1. Prerequisites
  2. Install Streamlit on Windows
  3. Install Streamlit on macOS/Linux

Before you get started, you're going to need a few things:

If you haven't already, take a few minutes to read through Main concepts to understand Streamlit's data flow model.

Regardless of which package management tool you're using, we recommend running the commands on this page in a virtual environment. This ensures that the dependencies pulled in for Streamlit don't impact any other Python projects you're working on.

Below are a few tools you can use for environment management:

Streamlit's officially-supported environment manager on Windows is Anaconda Navigator.

If you don't have Anaconda install yet, follow the steps provided on the Anaconda installation page.

Next you'll need to set up your environment.

  1. Follow the steps provided by Anaconda to set up and manage your environment using the Anaconda Navigator.

  2. Select the "▶" icon next to your new environment. Then select "Open terminal":

    "Open terminal" in Anaconda Navigator
  3. In the terminal that appears, type:

    pip install streamlit
    
  4. Test that the installation worked:

    streamlit hello
    

    Streamlit's Hello app should appear in a new tab in your web browser!

  1. In Anaconda Navigator, open a terminal in your environment (see step 2 above).

  2. In the terminal that appears, use Streamlit as usual:

    streamlit run myfile.py
    

Streamlit's officially-supported environment manager for macOS and Linux is Pipenv. See instructions on how to install and use it below.

  1. Install pip.

    On a macOS:

    sudo easy_install pip
    

    On Ubuntu with Python 3:

    sudo apt-get install python3-pip
    

    For other Linux distributions, see How to install PIP for Python.

  2. Install pipenv.

    pip3 install pipenv
    
  1. Navigate to your project folder:

    cd myproject
    
  2. Create a new Pipenv environment in that folder and activate that environment:

    pipenv shell
    

    When you run the command above, a file called Pipfile will appear in myprojects/. This file is where your Pipenv environment and its dependencies are declared.

  3. Install Streamlit in your environment:

    pip install streamlit
    

    Or if you want to create an easily-reproducible environment, replace pip with pipenv every time you install something:

    pipenv install streamlit
    
  4. Test that the installation worked:

    streamlit hello
    

    Streamlit's Hello app should appear in a new tab in your web browser!

  1. Any time you want to use the new environment, you first need to go to your project folder (where the Pipenv file lives) and run:

    pipenv shell
    
  2. Now you can use Python and Streamlit as usual:

    streamlit run myfile.py
    
  3. When you're done using this environment, just type exit or press ctrl-D to return to your normall shell.

Was this page helpful?

editSuggest edits
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.