Skip to content

Details


Streamlit is a python library that makes easy to create and share the web applications with out html, css and javascript.

1. Pre-requisites

  • Python Version > 3.6

2. Installation

  • Standalone

    • pip install streamlit
    • streamlit hello
  • Anaconda

    • conda create --name streamlit (create new environment)
    • conda activate streamlit (activate)
    • pip install streamlit
    • streamlit hello
    • conda deactivate (to deactivate )
  • Venv (Built in python no need to do pip install)

    • python -m venv streamlit (create new environment)
    • cd pathtostreamlit\Scripts\activate.bat (activate)
    • pip install streamlit
    • streamlit hello
    • cd pathtostreamlit\Scripts\deactivate.bat (deactivate)
  • Virtualenv

    • pip install virtualenv
    • virtual streamlit (create new environment)
    • cd pathtostreamlit\Scripts\activate.bat (activate)
    • pip install streamlit
    • streamlit hello
    • cd pathtostreamlit\Scripts\deactivate.bat (deactivate)
  • Pipenv

    • pip install pipenv
    • pipenv install streamlit
    • pipenv shell or pipenv run (activate)
    • streamlit hello
    • exit (deactivate)

3. Uninstallation

  • pip uninstall streamlit

4. Commands

  • Basic Commands

    • streamlit --help
    • streamlit hello
    • streamlit config show
    • streamlit cache clear
    • streamlit docs
    • streamlit --version
  • Run Command

    • streamlit run scriptname.py
    • streamlit run 'url.py' (Github or Gist)
      • Gist Example - streamlit run https://gist.github.com/SurendraRedd/feaa6f29961501fa9fce7a45abc14651/raw/Example.py
      • GitHub Example - streamlit run https://github.com/SurendraRedd/StreamlitProjects/blob/master/Example.py
    • streamlit run app.py --server.port 8503 (to run in different port)

5. Run Gist/GitHub

streamlit run https://gist.github.com/SurendraRedd/eaa6f29961501fa9fce7a45abc14651/raw/Example.py

streamlit run https://github.com/SurendraRedd/StreamlitProjects/blob/master/Example.py