Install Streamlit using Anaconda Distribution

This page walks you through installing Streamlit locally using Anaconda Distribution. At the end, you'll build a simple "Hello world" app and run it. You can read more about Getting started with Anaconda Distribution in Anaconda's docs. If you prefer to manage your Python environments via command line, check out how to Install Streamlit using command line.

  1. A code editor

    Anaconda Distribution includes Python and basically everything you need to get started. The only thing left for you to choose is a code editor.

    Our favorite editor is VS Code, which is also what we use in all our tutorials.

  2. Knowledge about environment managers

    Environment managers create virtual environments to isolate Python package installations between projects. For a detailed introduction to Python environments, check out Python Virtual Environments: A Primer.

    But don't worry! In this guide we'll teach you how to install and use an environment manager (Anaconda).

  1. Go to anaconda.com/download.

  2. Install Anaconda Distribution for your OS.

  1. Open Anaconda Navigator (the graphical interface included with Anaconda Distribution).

  2. You can decline signing in to Anaconda if prompted.

  3. In the left menu, click "Environments".

    Open your environments list in Anaconda Navigator

  4. At the bottom of your environments list, click "Create".

    Click "Create" to open the Create new environment dialog

  5. Enter "streamlitenv" for the name of your environment.

  6. Click "Create."

Finalize your new conda environment
  1. Click the green play icon (play_circle) next to your environment.

  2. Click "Open Terminal."

    Open a new terminal with your environment activated

  3. A terminal will open with your environment activated. Your environment's name will appear in parentheses at the beginning of your terminal's prompt to show that it's activated.

  1. In your terminal, type:

    pip install streamlit
  2. To validate your installation, enter:

    streamlit hello

    If this doesn't work, use the long-form command:

    python -m streamlit hello
  3. The Streamlit Hello example app will automatically open in your browser. If it doesn't, open your browser and go to the localhost address indicated in your terminal, typically http://localhost:8501. Play around with the app!

  4. Close your terminal.

  1. Open VS Code with a new project.

  2. Create a Python file named app.py in your project folder.

    Create a new file called app.py

  3. Copy the following code into app.py and save it.

    import streamlit as st st.write("Hello World")
  4. Click your Python interpreter in the lower-right corner, then choose your streamlitenv environment from the drop-down.

    Set your Python interpreter to your streamlitenv environment

  5. Right-click app.py in your file navigation and click "Open in integrated terminal".

    Open your terminal in your project folder

  6. A terminal will open with your environment activated. Confirm this by looking for "(streamlitenv)" at the beginning of your next prompt. If it is not there, manually activate your environment with the command:

    conda activate streamlitenv
  7. In your terminal, type:

    streamlit run app.py

    If this doesn't work, use the long-form command:

    python -m streamlit run app.py
    Start your Streamlit app with streamlit run app.py
  8. Your app will automatically open in your browser. If it doesn't for any reason, open your browser and go to the localhost address indicated in your terminal, typically http://localhost:8501.

  9. Change st.write to st.title and save your file:

    import streamlit as st st.title("Hello World")
  10. In your browser, click "Always rerun" to instantly rerun your app whenever you save a change to your file.

    Automatically rerun your app when your source file changes

  11. Your app will update! Keep making changes and you will see your changes as soon as you save your file.

    Your app updates when you resave your source file

  12. When you're done, you can stop your app with Ctrl+C in your terminal or just by closing your terminal.

Read about our Basic concepts and try out more commands in your app.

forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.