Raspberry pi streamlit

@randyzwitch the above suggests a route forward could be to split out requirements for custom components as an optional install, something like pip install streamlit[custom-components]

As of version 0.85, Arrow is no longer optional :slight_smile:

For those using this solution. The new url for wget is: https://apache.jfrog.io/artifactory/arrow/ubuntu/apache-arrow-archive-keyring-latest-focal.deb

For those who are looking for a solution, this worked for me:

How to Install Streamlit on Raspberry Pi 4 Model B (8gb)

  1. Download the latest version of Raspberry Pi OS 64-bit (raspios_arm64) from here

  2. Write the image on your SD Card

  3. Install Miniforge

$ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
$ chmod +x Miniforge3-Linux-aarch64.sh
$ ./Miniforge3-Linux-aarch64.sh
$ sudo reboot
  1. After reboot:
$ conda update conda
$ conda config --add channels conda-forge
$ conda config --set channel_priority strict
$ conda create -n streamlit
$ conda activate streamlit 
$ conda install -c conda-forge streamlit
  1. check if it works
$ streamlit hello
2 Likes

Works for me. Thanks.

2 Likes

I have to struggle with 32 bits on my raspberry pi 4 to install streamlit. After that I have installed 64 bits on my raspberry pi 4 with following system:

Ubuntu 20.04.3 LTS
Linux ubuntu-pi-cam-211121 5.4.0-1046-raspi #50-Ubuntu SMP PREEMPT Thu Oct 28 05:32:10 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

just use pip to install streamlit:
$pip install streamlit

It works fine.

1 Like

I had 32 bit OS installed on my pi, streamlit didn’t work .
But my hardware is aarch64,
So I installed a 64 bit OS and did this command-
$ sudo pip install streamlit
It worked for me :smile: :smile:.

Thanks to all…

1 Like

@zhou_sean It works for me thanks.

Hello Jensottos, Could you please guide me on how to run streamlit app on raspberry pi4, Im kind of new to this.

1 Like

Still no cake for 32bit armv7l

I’m also quite suprised why it works for 64bit: piwheels - pyarrow

Probably because the underlying arrow library does not compile on 32bit. Even on pypi you can only find 64bit versions. That is why there will probably never be a 32bit version.

If you don’t have a Raspberry Pi that is too old, you are therefore better advised to switch to a 64bit Raspbian OS.

After putting a ton of effort trying to get pyarrow to compile on arm32v7 / armhf, it seems almost impossible to do it.

Luckily there is one last (desperate) way to get streamlit to run on arm32v7, and that is to run it without pyarrow. Unless you plan on displaying large dataframes, you can still get away with the legacy serialization format which is slower than pyarrow.

First, we need to install all required dependencies of streamlit except pyarrow. Then pip install streamlit --no-dependencies

Then the trick is to mock pyarrow before running streamlit so as to avoid import errors. This way streamlit is tricked into thinking pyarrow is installed, which allows it to work as usual. Of course, when actually requesting pyarrow functionality we would get undefined errors due to the mocking, but as I said we can easily stay away from that.

You can find more details in the github repo where I have a streamlit application working on Raspberry PI 3B+.

2 Likes

Thank you so much for this! I’ve been struggling with this issue for a few days now and was about to give up.

Some more information on how I got it working with docker, based on dorinclisu invention:

  • copy file streamlit_no_pyarrow.py and mock_pyarrow.py into your app folder
  • copy the .streamlit folder to your app folder
  • do a pip freeze < requirements.txt
  • remove pyarrow from requirements txt
  • add the no dependency option to pip install:
    RUN pip install -r requirements.txt --no-dependencies
  • change the entry point to something like:
    ENTRYPOINT ["python", "streamlit_no_pyarrow.py", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]