This tutorial will take you through launching a simple virtual environment running Streamlit.
Please ensure you have already installed ContainDS and Docker (or alternatives) as described in Installation and Setup, and have ContainDS running.
Launch a Streamlit Container
After setting up and running ContainDS you should see the ‘new container’ screen:
From the list of recommended Streamlit images look for ‘streamlit-launchpad’. Click ‘SELECT’ next to that image.
On the next screen you can choose a different name for the new container (i.e. for the environment/workspace pair) if you like.
You need to input the workspace folder – where on your computer’s drive you would like your py files and data to be stored. The default will be an empty folder which ContainDS will create. However, you can select an existing folder which already contains notebook files or other data, perhaps cloned from a git repo. Below, we’ve left the default path for a new empty folder which will be created automatically.
Click ‘CREATE’. You will see a progress animation while the image is downloaded from Docker Hub. When the container is ready, you will see the Streamlit console logs:
There aren’t any apps (py files) to run yet, so let’s make one. Copy the contents of Streamlit’s example intro.py into a file called intro.py in the workspace folder. The full path to your folder can be seen next to ‘Workspace’ above, and you can click it to open the folder in Explorer or Finder.
Click on the ‘WEB’ button, or ‘Launch Streamlit in Browser’, to launch Streamlit Launchpad in your default web browser:
Click on intro.py to see your app:
If you need to install any Python packages, click the CMD button when your container is highlighted in ContainDS. This will launch a command prompt (or terminal) where you can
pip install packages.
For full details on possibilities for starting new containers see New Container Options.
And don’t forget to sign up to our newsletter to find out about new features and guides!