This is an instantly-working M1-native Streamlit development environment using VSCode, Docker, and Conda.
Getting a working development environment on OSX is challenging these days with the new Apple M1 chip. This makes it super easy to get a working development environment.
Note: If you use the Apple Silicon build for VS Code, you'll get a much faster experience, but technically this will still work in the Intel-based VSCode.
- Clone this repo (
git clone https://github.com/jroes/streamlit-getting-started-m1
) - Open in VSCode (
code .
) - Press Cmd+Shift+P and search for "Dev Containers: Reopen in Container"
This will build the underlying Docker container. From there you should be able to do things like:
- Open a new Terminal window in VSCode and run
streamlit hello
- Run any other streamlit commands, such as
streamlit run streamlit_app.py
- VSCode will automatically ask you to open/re-route ports so you can access the app, and give you a link to visit your app in a browser.
This repository contains:
- A Dockerfile that sets up a working Python 3.8 + conda + Linux environment for ARM-based CPUs (e.g. the new Apple M1 chip)
- A devcontainer.json that will automatically configure VSCode to build & use this container.
- A fairly-empty streamlit_app.py you can
streamlit run
as a starting point.
Much of this work would not be possible without the work that the VSCode team has done in building images for standard platforms.
There's also some great work that exists from the conda-forge team that includes aarch64-compatible builds of various dependencies.