How to clean install Streamlit

If you run into any issues while installing Streamlit or if you want to do a clean install, don’t worry, we’ve got you covered. In this guide, we’ll show you how to clean install Streamlit for Windows, macOS, and Linux.

Install Streamlit on Windows

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

Install Anaconda

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

Create a new environment with Streamlit

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!

Use your new environment

  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
    

Install Streamlit on macOS/Linux

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

Install Pipenv

  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
    

Create a new environment with Streamlit

  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!

Use your new environment

  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.