Awesome Streamlit Readthedocs Io en Latest
Awesome Streamlit Readthedocs Io en Latest
2 Awesome Streamlit 7
3 Awesome Streamlit 19
4 Contribution Guidelines 27
i
ii
Awesome Streamlit Documentation
1.1 Alternative
• Bokeh (#Alternative)
• Jupyter Voila (#Alternative)
• Panel (#Alternative)
• Plotly Dash (#Alternative)
1.2 App
1.3 Awesome-Streamlit.org
3
Awesome Streamlit Documentation
1.4 Code
• Awesome Streamlit Test Runner by Marc Skov Madsen (#App In Gallery, #Code)
• Country Indicators by Marc Skov Madsen (#App In Gallery, #Code, #Voila)
• Deploying Streamlit app to EC2 instance (#Code)
• Iris EDA App by Jesse E. Agbe (JCharis) (#App In Gallery, #Code)
• NBA Roster Turnover by Kevin Arvai (#App In Gallery, #Code)
• Self Driving Cars by Streamlit (#App In Gallery, #Code)
• Sentiment Algorithm by Paras Patidar (#App In Gallery, #Code, #Machine Learning)
• SpacyIO by Ines Montani (#App In Gallery, #Code, #NLP)
• Spreadsheet by Marc Skov Madsen (#App In Gallery, #Code)
• Streamlit-components-demo Code (#Code)
• Uber Data Explorer App (#Code)
• Uber NYC Pickups by Streamlit (#App In Gallery, #Code)
• Yahoo Finance by Marc Skov Madsen (#App In Gallery, #Code, #Finance)
1.5 Social
1.6 Streamlit.io
1.7 Technical
1.8 Tutorial
• A step by step guide to running streamlit pytorch and bert on a cheap aws instance (#Article, #Deployment,
#Tutorial)
• Building a ui for your latest ai by Luke Posey (#Article, #Tutorial)
• Building an Iris EDA App with Streamlit and Python by Jesse E. Agbe (JCharis) (#Tutorial, #Video)
• Full-Stack AI: Building a UI for Your Latest AI Project in No Time at All (#Article, #Image Recognition,
#Tutorial)
• How To Deploy Streamlit Apps (Using Heroku) (#Deployment, #Tutorial, #Video)
• How to build your machine learning app in 3 simple steps (#Article, #Deployment, #Tutorial)
• How to create and deploy data exploration web app easily using python (#Article, #Deployment, #Tutorial)
• How to write web apps using simple python for data scientists (#Article, #Tutorial)
• Streamlit Python Tutorial (Crash Course) by Jesse E. Agbe (JCharis) (#Tutorial, #Video)
1.7. Technical 5
Awesome Streamlit Documentation
The fastest way to build Awesome Tools and Apps! Powered by Python!
The purpose of this project is to share knowledge on how Awesome Streamlit is and can become. Pull requests are
very welcome!
Streamlit has just been announced (Oct 2019) but I see the potential of becoming the Iphone of Data Science Apps.
And maybe it can even become the Iphone of Technical Writing, Code, Micro Apps and Python.
This project provides
• A curated list of Awesome Streamlit resources. See below.
• An awesome Streamlit application with a gallery of Awesome Streamlit Apps.
– Feel free to add your awesome app to the gallery via a Pull request. It’s easy (see below).
• A vision on how awesome Streamlit is and can become.
• A best practices example and starter template of an awesome, multipage app with an automated CI/ CD
pipeline, deployed to the cloud and running in a Docker container.
Visit the app at awesome-streamlit.org!
Awesome Streamlit Org Animation
The only way to truly understand how magical Streamlit is to play around with it. But if you need to be convinced
first, then here is the 4 minute introduction to Streamlit!
Afterwards you can go to the Streamlit docs to get started. You might also visit Awesome Streamlit docs.
Introduction to Streamlit
7
Awesome Streamlit Documentation
2.2.1 Alternative
• Bokeh (#Alternative)
• Jupyter Voila (#Alternative)
• Panel (#Alternative)
• Plotly Dash (#Alternative)
2.2.2 App
2.2.3 Article
• Intermediate Streamlit - Tips and Tricks for an evolving app by Peter Baumgartner (#Article)
2.2.4 Awesome-Streamlit.org
2.2.5 Code
• Awesome Streamlit Test Runner by Marc Skov Madsen (#App In Gallery, #Code)
• Bokeh Experiments by Marc Skov Madsen (#App In Gallery, #Code)
• Country Indicators by Marc Skov Madsen (#App In Gallery, #Code, #Voila)
• Deploying Streamlit app to EC2 instance (#Code)
• Emojis by Marc Skov Madsen (#App In Gallery, #Code)
• File Download Workaround by Marc Skov Madsen (#App In Gallery, #Code)
• File Uploader by Marc Skov Madsen (#App In Gallery, #Code)
• File Uploader - Multiple Files by Marc Skov Madsen (#App In Gallery, #Code)
• Image Classifier by Marc Skov Madsen (#App In Gallery, #Code)
• Iris Classifier by Noah Saunders (#App In Gallery, #Code, #Machine Learning)
• Iris EDA App by Jesse E. Agbe (JCharis) (#App In Gallery, #Code)
• Kickstarter Dashboard by Marc Skov Madsen (#App In Gallery, #Code)
• Layout Experiments by Marc Skov Madsen (#App In Gallery, #Code)
• ML App registry by Boadzie Daniel (#App In Gallery, #Code, #Machine Learning)
• Medical Language Learner Model by Georgi Tancev (#App In Gallery, #Code, #NLP)
• Mining and Classifying Medical Text Documents by Georgi Tancev (#App, #Code)
• NBA Roster Turnover by Kevin Arvai (#App In Gallery, #Code)
• Owid Dashboard by Marc Skov Madsen (#App In Gallery, #Code)
• Self Driving Cars by Streamlit (#App In Gallery, #Code)
• Sentiment Algorithm by Paras Patidar (#App In Gallery, #Code, #Machine Learning)
• SpacyIO by Ines Montani (#App In Gallery, #Code, #NLP)
• Spreadsheet by Marc Skov Madsen (#App In Gallery, #Code)
• Streamlit-components-demo Code (#Code)
• Table Experiments by Marc Skov Madsen (#App In Gallery, #Code)
• Uber Data Explorer App (#Code)
• Uber NYC Pickups by Streamlit (#App In Gallery, #Code)
• Yahoo Finance by Paduel (#App In Gallery, #Code, #Finance)
2.2.6 Guide
• Host Streamlit on Heroku with Nginx basic authentication by Alexandre Domingues (#Code, #Guide)
2.2.8 Social
2.2.9 Streamlit.io
2.2.10 Technical
2.2.11 Tutorial
• A step by step guide to running streamlit pytorch and bert on a cheap aws instance (#Article, #Deployment,
#Tutorial)
• Building a ui for your latest ai by Luke Posey (#Article, #Tutorial)
• Building an Iris EDA App with Streamlit and Python by Jesse E. Agbe (JCharis) (#Tutorial, #Video)
• Full-Stack AI: Building a UI for Your Latest AI Project in No Time at All (#Article, #Image Recognition,
#Tutorial)
• How To Deploy Streamlit Apps (Using Heroku) (#Deployment, #Tutorial, #Video)
• How to build your machine learning app in 3 simple steps (#Article, #Deployment, #Tutorial)
• How to create and deploy data exploration web app easily using python (#Article, #Deployment, #Tutorial)
• How to write web apps using simple python for data scientists (#Article, #Tutorial)
• Mining and Classifying Medical Text Documents by Georgi Tancev (#Article, #Deployment, #NLP, #Tutorial)
• Streamlit Python Tutorial (Crash Course) by Jesse E. Agbe (JCharis) (#Tutorial, #Video
2.3 Governance
Thanks
2.4 Contribute
"""
## APP NAME
DESCRIPTION
def main():
st.title("APP NAME")
st.markdown("DESCRIPTION")
if __name__ == "__main__":
main()
• Please note magic in sub pages does not work. So don’t use magic.
2.4. Contribute 11
Awesome Streamlit Documentation
Streamlit.io is in the position of trying to balance building an awesome, succesfull business and providing an awesome
product to the open source community.
If you are in a Team please consider signing up for the beta of
• Streamlit for teams
If you would like to sponsor my time or the infrastructure the platform is running on, feel free to reach out via
datamodelsanalytics.com.
You can also appreciate the work I have already done if you
Buy me a coffee
Thanks
Marc
2.5 LICENSE
2.6.1 Prerequisites
2.6.2 Installation
cd awesome-streamlit
via python
source .venv/Scripts/activate
or alternatively
source .venv/bin/activate
.venv/Scripts/activate.bat
or via anaconda
activate awesome-streamlit
If you don’t wan’t to clone the repo and build the docker container you can just use docker run to run the image
from Dockerhub
To run bash interactively
We use
• isort for sorting import statements
• autoflake to remove unused imports and unused variables
• black the opinionated code formatter
I’ve created a first version of an awesome streamlit test runner. You run it via
streamlit run test_runner_app.py
or in Docker
docker run -it -p 80:80 --entrypoint "streamlit" marcskovmadsen/awesome-
˓→streamlit:latest run test_runner_app.py
2.6.7 Workflow
We use the power of Invoke to semi-automate the local workflow. You can see the list of available commands using
$ invoke --list
Available tasks:
2.6.8 Configuration
Please note that Streamlit has its own config files in the ~/.streamlit folder.
The application is
• build as a Docker image and tested via Azure Pipelines builds
– You find the Dockerfiles here and the Azure pipelines yml files here
Azure
Pipelines
• pushed to the Dockerhub repository marcskovmadsen/awesome-streamlit.
Dockerhub
• released via Azure Pipelines
Azure
Pipelines
• to a web app for containers service on Azure on the cheapest non-free pricing tier
Azure Pipelines
cd package
python setup.py sdist bdist_wheel
.
app.py
As our application grows we would refactor our app.py file into multiple folders and files.
• assets here we keep our css and images assets.
• models - Defines the layout of our data in the form of
– Classes: Name, attribute names, types
– DataFrame Schemas: column and index names, dtypes
– SQLAlchemy Tables: columns names, types
• pages - Defines the different pages of the Streamlit app
• services - Organizes and shares business logic, models, data and functions with different pages of the Streamlit
App.
– Database interactions: Select, Insert, Update, Delete
– REST API interactions, get, post, put, delete
– Pandas transformations
and end up with a project structure like
.
app.py
src
assets
(continues on next page)
Further refactoring is guided by by this blog post and the Angular Style Guide.
We place our tests in a test folder in the root folder organized with folders similar to the app folder and file names
with a test_ prefix.
.
test
test_app.py
core
| services
| test_service1.py
| test_service2.py
pages
| pages
| page1
| | test_page1.py
| page2
shared
models
| test_model1.py
| test_model2.py
components
test_component1.py
test_component2.py
3.1 Disclaimer
THE BELOW IS VERY PRELIMINARY AND RAPIDLY DEVELOPING! IT’S A VISION and a HYPOTHESIS.
NOT FACTS! MIGHT CHANGE A LOT.
I JUST DISCOVERED JUPYTER VOILA WHICH MIGHT BE AN ALTERNATIVE. I DO NOT KNOW HOW
THAT COMPARES. I WILL DESCRIBE THAT BELOW ASAP.
3.2 Introduction
This article will discuss if Streamlit is awesome and how awesome it can be.
Streamlit is announced as being The fastest way to build custom ML tool but we believe it has the potential to
become much more awesome than that.
Streamlit Video
The best way to think about the arrival of Streamlit is to think of the arrival of the Iphone being announced as the
smartest way to place calls and send text messages. Well yes :-). But now we can see that it’s a powerfull compute
engine and an ecosystem of apps that has changed peoples lifes.
Streamlit has just arrived (Oct 2019). So it’s too early tell if Streamlit will become truly awesome.
But we see the potential to become the Iphone of Data Science, Technical Writing, Micro Apps, Code, Python
and more. It has the potential to change the way we share knowledge and create tools and applications because it’s so
plain simple to use.
This article was inspired by a reply in this post on LinkedIn and some replies to the announcement in the Streamlit
Community.
You can find a curated list of Awesome Streamlit resources here
19
Awesome Streamlit Documentation
3.3 Contribute
Data Science is a very broad category. It’s used for to categorize work such as
• data transformations and visualisations in excel
• interactive data visualisations in BI Tools like Power BI and Tableau
• Building Fundamental, Statistical, Mathematical, Machine Learning or Deeplearning models in Python, R etc.
• Building applications on top of data science models and deploying them to production using web frameworks
such as Bokeh/ Dash, Flask/ Django and React/Vue/Angular.
and much more
But actually every body extracting, transforming, loading and presenting data are actually doing work very similar to
data scientists. If they are very structured about it and using methodologies from software development they are called
Data Engineers, ML Engineers or Platform Engineers :-)
3.4.1 Notebooks
Notebooks - Situation
One of the revolutionary tools of modern data science is the Jupyter Notebook.
Awesome
The jupyter notebook provides an environment for working very exploratory and visually within data science
Notebooks - Problem
A jupyter notebook cannot really be deployed directly to production and the users.
So Notebooks do not facilitate rapid sharing, exploration, testing and improvement cycle you would like.
Bottom line. Notebooks makes deployment of data science products costly.
Notebooks - Complication
• It changes the Notebook from being a simple interactive document that you can read and distribute as pdf or
html to an advanced but complicated development environment that you work in.
Jupyter recently (Jun 2019) announced Voila which can transform Jupyter notebooks to standalone applications and
dashboards.
The approach is different than that of Streamlit. I have not yet tried Voila.
But for now I believe that the code in your editor, use caching and only transfer incremental data of Streamlit is a very
strong and unique approach. Also the magical api of Streamlit is different but very, very simple to use.
Whether Streamlit can compete with the massive popularity and library of widgets of Jupyter is yet to be seen. Or
whether Voila will quickly learn from Streamlit.
See Hacker News Discussion for a little bit of technical discussion.
More to come
Notebooks - Solution
Streamlit aims to solve all of the problems described above as described in the Announcement.
Streamlit Video
As you can see on the image above it simplifies everything by enabling data scientist to
• develop applications in just one python file (left side of image)
• using their editor of choice (VS Code on left side of image)
• producing a web application that can very easily be deployed to production. (right side of image)
And the application can provide the interactivity that you would normally be developing using a modern web frame-
work as React, Vue or Angular. So a single data scientist can develop a data science application in hours. No
large project or team required.
Streamlit provides self service data science.
And it’s very appealing to data scientists as they can develop an application in the way they find simple, productive
and fun
• Text as MarkDown
• Code in Python
• All of your data science modelling libraries at hand like Pandas, SciKitLearn, PyTorch, Keras, TensorFlow etc.
• All of your data science visualisation libraries at hand like Matplotlib, Vega and Plotly.
• No HTML and No Javascript is required.
I believe that the Jupyter Notebook is a cell phone and Streamlit is the Iphone of Data Science
• There will be a lot less demand for front end developers and development in React, Vue an Angular in data
science.
– The remaining front end developers in data science should be developing specialized Web Components for
Streamlit when needed.
• There will be less demand for back end developers to develop REST APIs etc. for data science products.
• Streamlit is so simple to use that business users across an enterprise can create apps them selves. It’s the
democratization of Data Science Apps.
– Actually we believe the development cycle will be
* Business users and data scientists develop data science apps independently or together and deploy to
production.
* The most valuable apps will be identified and the quality and governance of these apps will be im-
proved and maintained. They will get an approval as Enterprise Ready apps. But probably as this is so
simple and there is revision control and pull requests Business Users and Data Scientist will be able
to continue the development of these apps.
• Business should start experimenting with this technology to find it’s use cases and limits and evaluate how and
when to start using Streamlit securely.
– As time to market is so important you should start moving!.
• IT departments should
– Describe their way of securely deploying these applications to on-premise or cloud and
– join the one-click deployment solution for Teams beta.
For building larger, traditional applications with data science app components the data science app components can
in a lot of cases be build in Streamlit and embedded in the larger application. REST API endpoints should still be
developed when the need is there.
Streamlit is very new. There will be rough edges and things you cannot yet do. And maybe it turns out the product is
not secure or something else. Who knows? But as the principles and api of Streamlit is so simple and productive we
believe they will be developed and fixed very rapidly.
Things you cannot do yet
• Select from thousands of web components to make your application interactive.
– The basic ones are there
• Deploy to production with one click.
– It can be deployed as any other python web application. And it’s only one file, the streamlit package and
any data science packages needed. So it’s very simple to deploy one you have done it once.
More to come
3.5.2 Spreadsheets
As Streamlit apps are so simple, the quality so high and robust and it enjoys the power of Python a lot business users
will transform from developing spreadsheets into developing Streamlit application.
Spreadsheets - Implications
Another category of revolutionary tools for data science are data reporting and visualization tools like Power BI and
Tableau.
3.5.5 Bokeh
3.5.6 Dash
Problem: You still need to master HTML and manage callbacks. Focus on Plotly charts mainly. The development
cycle is slow. The api is not “magical”.
Implications:
For some use case where you wan’t a high degree of flexibility in layout and formatting, you might still need Dash.
Implications:
3.5.9 Binder
Not needed?
3.7 Code
Streamlit lowers the barrier to entry for young and new programmers. One file in an editor is all that is needed to
develop a powerfull app. Somebody will abstract away the rest in a cloud solution.
When you can build something like this is a few hours you know something will change.
Video
You can find the code here. See the original tweet here
3.9 Python
Streamlit reduces the barrier to entry and enables even more people to enjoy the power of Python.
3.10 More
To come
3.7. Code 25
Awesome Streamlit Documentation
Contribution Guidelines
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree
to abide by its terms.
** The pull request should have a useful title. Pull requests with Update readme.md as title will be closed right
away because I’m so tired of nobody reading this document. Please carefully read everything in Adding to this
list.**
27
Awesome Streamlit Documentation
If you have something awesome to contribute to an awesome list, this is how you do it.
You’ll need a GitHub account!
1. Access the awesome list’s GitHub page. For example: https://github.com/sindresorhus/awesome
Step
4 - Edit the file
5. Say why you’re proposing the changes, and then click on “Propose file change”.
Step
5 - Propose Changes
6. Submit the pull request!
Sometimes, a maintainer of an awesome list will ask you to edit your Pull Request before it is included. This is
normally due to spelling errors or because your PR didn’t match the awesome-* list guidelines.
Here is a write up on how to change a Pull Request, and the different ways you can do that.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
participation in our project and our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race,
religion, or sexual identity and orientation.
31
Awesome Streamlit Documentation
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appro-
priate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
5.4 Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
project or its community. Examples of representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed representative at an online or offline
event. Representation of a project may be further defined and clarified by project maintainers.
5.5 Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team
at [email protected]. All complaints will be reviewed and investigated and will result in a response that is
deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with
regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
repercussions as determined by other members of the project’s leadership.
5.6 Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at http://contributor-
covenant.org/version/1/4
You can use the multi-command extension to configure a keyboard short cut to execute streamlit run
<relativeFile.py>
You start by installing the multi-command extension and adding the configuration shown to your settings.json file.
VS
Code multi-command
{
"command": "multiCommand.streamlitActiveFile",
"label": "Streamlit: Run Active File",
"description": "Streamlit run active file in active terminal",
"sequence": [
"workbench.action.terminal.focus",
{
(continues on next page)
33
Awesome Streamlit Documentation
Then you can execute your streamlit run command via the command palette (CTRL+SHIFT+P)
VS
Code multi-command execute
{
"key": "ctrl+m ctrl+s",
"command": "multiCommand.streamlitActiveFile",
},
VS
Code multi-command Streamlit Run
Or you can setup a keyboard shortcut in your keybindings.json file to run Streamlit
VS
VS
Code keybindings
VS Code
terminal
6.2 Debugging
You can debug mannually by inserting a breakpoint() (Python 3.7+) or import pdb;pdb.set_trace()
(Python 3.6 or below) in your code.
6.2. Debugging 35
Awesome Streamlit Documentation
Debugging
via breakpoint
You can also use the integrated debugger in VS Code via the ptvsd Python package
Please note that andaag reported the below to not work on ubuntu 18.04.3 LTS with Python 3.6.8. He gets a
ValueError: signal only works in main thread error. See issue 648. It’s working really well for
me on Windows with Python 3.7.4 though.
First you should pip install ptvsd.
Then you need to insert the following snippet in your <your-app_name>.py file.
import ptvsd
ptvsd.enable_attach(address=('localhost', 5678))
ptvsd.wait_for_attach() # Only include this line if you always wan't to attach the
˓→debugger
Then you should configure your Remote Attach: debug PTVSD option
Add
Configuration
Debug
Configuration
6.2. Debugging 37
Awesome Streamlit Documentation
and update to the below in your launch.json file. Please make sure that you manually insert the redirectOutput setting
below.
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost",
"justMyCode": true,
"redirectOutput": true,
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
]
}
Please note that by default you will be debugging your own code only. If you wan’t to debug into for example the
streamlit code, then you can change the justMyCode setting from true to false.
Finally you can attach the debugger by clicking the debugger play button
Integrated
Debugger
You can create a snippet in your python.json snippet configuration to insert the import ptvsd... code.
ptvsd
code snippet
6.2. Debugging 39
Awesome Streamlit Documentation
ptvsd
code snippet
ptvsd
code snippet
"ptvsd": {
"prefix": "ptvsd debugging snippet",
"body": [
"import ptvsd",
"ptvsd.enable_attach(address=('localhost', 5678))",
"print('Ready to attach the VS Code debugger')",
"ptvsd.wait_for_attach() # Only include this line if you always wan't to
˓→attach the debugger",
],
"description": "Inserts snippet to setup debugging via ptvsd"
},
Adding and removing the ptvsd code above can be cumbersome. So a usefull trick is to setup a dedicated
app_debug_vscode.py file for debugging.
Assuming your app.py file has a def main(): function, then your app_debug_vscode.py file could look as follows
"""Use this module for development with VS Code and the integrated debugger"""
import ptvsd
import streamlit as st
import app
# pylint: disable=invalid-name
markdown = st.markdown(
"""
## Ready to attach the VS Code Debugger!
ptvsd.enable_attach(address=("localhost", 5678))
ptvsd.wait_for_attach()
markdown.empty()
app.main()
then you run streamlit run app_debug_vscode.py instead of streamlit run app.py and attach the
debugger.
For a use case see my app.py and app_dev_vscode.py files.
When you are running your integrated debugging in VS Code, you can use the Debugging Console with Streamlit if
you import streamlit as st. Then you can write dataframes and charts to the browser window and take a
better look at your data, than you can in VS Code.
6.2. Debugging 41
Awesome Streamlit Documentation
Import
Streamlit Import
6.2. Debugging 43
Awesome Streamlit Documentation
Streamlit Import
Streamlit
You should also remember to print your dataframes to the debugger console to get a nice formatting.
Nice
Print of DataFrame
6.3 Installing the Streamlit Repo for Development using Visual Studio
Online
I would like to experiment with and maybe contribute to the streamlit/streamlit repo.
There is an official Streamlit Contributing guide I can follow to get up and running.
But I’m running on Windows 8.1 so it’s a it problematic getting it up and running.
• I cannot install directly on Windows because the Makefile and associated tools are very dependent on Linux.
• I cannot use Visual Studio Code Remote - Containers as described here because it requires Windows 10 (not
8.1) and Docker (not Docker Toolbox)
• Maybe I could have installed Linux on my machine. But . . .
• I guess I could install in a Docker container locally but not integrate with VS Code. But that would not be
efficient.
I then settled on trying out the new Visual Studio Online experience. I got it working successfully after some time.
Below I will describe the steps.
DISCLAIMER: THE BELOW WAS SO COMPLICATED AND HAD TO BE REPEATED SEVERAL TIMES THAT
I CANNOT GUARENTEE THAT IT WILL WORK 100%. BUT I HOPE IT STILL HELPS A LOT.
IF SOMETHING GOES WRONG TAKE A LOOK AT THE TROUBLE SHOOTING SECTION BELOW.
Fork
Button
That’s it! Now I have a fork of the original streamlit/streamlit repository.
6.3. Installing the Streamlit Repo for Development using Visual Studio Online 45
Awesome Streamlit Documentation
Fork
of Streamlit
Visual Studio Online is a new experiment for working in VS Code locally, but running everything inside a docker
container environment in the cloud.
To create a docker container environment containing the streamlit repo I followed step 1-4 of the offical VS
Code Quickstart Guide. But I replaced the microsoft/vsonline-quickstart with <my-user-name>/
streamlit.
Replicate
with streamlit/streamlit
Finally the environment was created
Environment
created
and I click the connect button and it connects.
Environment
connected
6.3. Installing the Streamlit Repo for Development using Visual Studio Online 47
Awesome Streamlit Documentation
vsonline:~/workspace$ python
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
vsonline:~/workspace$ python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
vsonline:~/workspace$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
vsonline:~/workspace/Python-3.7.4$ nproc
4
Pyenv
and .bashrc
pipenv shell
6.3. Installing the Streamlit Repo for Development using Visual Studio Online 49
Awesome Streamlit Documentation
then run
make all-devel
I just followed the steps in the Contributing guide and the servers are running.
Servers
running
In order to open Streamlit in your browser you need to forward the ports 3000 and 8501.
6.3. Installing the Streamlit Repo for Development using Visual Studio Online 51
Awesome Streamlit Documentation
Forward
ports
Streamlit
hello
6.3.13 Troubleshooting
Sometimes VS Code cannot open the remote. I’ve filed an issue at MicrosoftDocs/vsonline issue #153
Opening
Remote issue
6.3. Installing the Streamlit Repo for Development using Visual Studio Online 53
Awesome Streamlit Documentation
I have experienced a few times that if I Toggle Developer Tools under the Help menu item then it starts reconnecting
and succeeds. Strange :-)
Developer
Tools
I could not exactly follow the Contributing guide. I’ve filed the issues I saw as streamlit/streamlit issue #665.
At some stage i could not get pyenv to work. So I followed the How to Install Python 3.7 on Debian 9 Guide with
• 3.7.3 replaced by 3.7.4.
• make -j 8 replaced by make -j 4
Please note that there will be plenty of time for coffea as the installation and tests take 30 minutes!
After verifying the installation I removed the temporary Python-3.7.4.tar.xz file and Python-3.7.4 folder.
rm Python-3.7.4.tar.xz
sudo rm -rf Python-3.7.4
When running
make all-devel
6.3. Installing the Streamlit Repo for Development using Visual Studio Online 55
Awesome Streamlit Documentation
The root cause is Tensorflow. Tensorflow does not support installation with pipenv according to pyp/pipenv issue
#2619 and similar issues.
The solution is to remove it from the Piplock File and install it manually
• genindex
• modindex
• search
57