Raspberry pi streamlit

We finally got around to publishing a conda-forge recipe, can someone try that out and let us know if it works on Raspberry Pi? If so, we’ll add that to our docs as a recommended solution

It works!

  • Raspberry Pi 4 Model B, 2 Gb RAM,
  • A fresh SD card with 2020-08-20-raspios-buster-arm64-lite.img (I haven’t done any update of raspios because that would just be a waste of time if the Streamlit install should fail)
  • $ wget https://github.com/Archiconda/build-tools/releases/download/0.2.3/Archiconda3-0.2.3-Linux-aarch64.sh
  • $ chmod +x Archiconda3-0.2.3-Linux-aarch64.sh
  • $ ./Archiconda3-0.2.3-Linux-aarch64.sh (takes quite a while)
  • $ conda install -c conda-forge streamlit (as @randyzwitch as suggested above)
  • Streamlit installs – but does not work yet (I got AttributeError: module ‘google.protobuf.descriptor’ has no attribute '_internal_create_key when I tried to run the streamlit hello app)
  • $ conda update conda -y
  • $ pip install --upgrade protobuf (this solved: AttributeError: module ‘google.protobuf.descriptor’ …)
  • $ pip install --upgrade pip (just for good measure – most likely not required)

And now “streamlit hello” is working! (of course one has to activate the virtual environment with the command “conda activate” but I suppose that goes without saying (but now I said it anyway :wink:))

Thank you very much. This has been a stone in the shoe for me for a long time.

6 Likes

Hi everybody!

I just discovered Streamlit and it’s exactly what I need.
I would like to know if there is a way to use it on my Raspberry PI 4 that I’m using for my Home Assistant domotic system.

I tried to install with different solutions but I failed : pyarrow problem!

I also see the 1st post above about the Home Assistant add-on: is it still available ?

Many thanks. :wink:

Nice! I’m tempted!

Before I buy, is it this one?

Thanks,
Charly

1 Like

@smilorel the approach on RPi is to install Streamlit using conda.
RE Home Assistant addon I did not update it since the conda option became available, please create a PR if you get time to work on the update :slight_smile:

Hi robmarkcole,

Thanks for your answer.

I tried to follow the last instruction (see jensottos post) to install conda on my Raspberry: I failed. I have the following message :

Solving environment : failed
PackagesNotFoundError: The following packages are not available from current channels:

  • pyarrow.

Could you please tell me what’s I’m doing wrong ? :slight_smile:

English langage isn’t my mother tongue langage: I don’t know what you mean by “PR”.

Make sure you added the channel: conda install -c conda-forge streamlit

PR = Pull request

Thanks for your answer.

It doesn’t work…

=> Here I have the following error : /home/…/archiconda3/bin/python : Exec format error.

it is simply install from the console:

$ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh

This repository holds a minimal installer for Conda specific to conda-forge. It is comparable to Miniconda, but with:

conda-forge set as the default channel

then just install with conda install streamlit
::

That shell script results in ./Miniforge3-Linux-aarch64.sh: 320: ./Miniforge3-Linux-aarch64.sh: /home/pi/miniforge3/conda.exe: Exec format error

Previous post got spam filtered. :frowning:

I had the same issues and after some trial and error ended up deploying on docker with poetry for dependencies.

I originally included the code here, but I’m guessing the spambot is somewhat twitchy with urls/code for new accounts. Trying again

The initial build takes about 50 minutes on a Raspberry Pi4 8gb overclocked at 1750 on DietPi 64bit.

I highly recommend using docker exec -it <imagename> /bin/bash, to prevent having to rebuild the image every external change to packages.

Hopefully this helps!

it is only for 64bit architecture (aarch64) if you have an S.O. 32bits (armhf) will not work because of the pyarrow library that is only for aarch64

2 Likes

I think 32 bit OS is my issue then - this is the default OS downloaded from raspberry pi website unfortunately

Dear Streamlit community

I have read all the messages here and tried all the various approaches listed by various developers/supporters but I am still having trouble installing Pyarrow while installing Streamlit.

Note: Streamlit version 0.62 works fine, but I need to use a higher version (>0.80).

I am using a 32 bit Raspberrypi (armhf).

@robmarkcole , can you please update us regarding the latest development on this issue?

@sercangul I believe conda is the recommended approach, although last time I tried this I too encountered issues and more or less wrote off streamlit on rpi

I am too facing the issue. Lower version works fine( 62 ) but then i have to manage the beta codes if i have to run streamlit . Sitting on this for a week now :frowning: :sleeping:

I tried this as well. Looks like i am missing something to run conda in my command prompt


I tried going to the website mentioned but doesnt solve my problem. Stuck with this for a week now :frowning:

I am able to address the conda installer issues by installing a miniconda3 and upgrading the python to a later version
conda install error

Hi,

I would like to test your procedure but I don’t understand all steps.

I have installed docker-compose but I can’t use it (“Command not found”).

Could you please help me ?
Thanks! :wink:

smilorel

Hello, its my first time here so sorry in advance if i don’t get any protocols right. After doing some research i realized that pyarrow may not necessarily be core to the functioning of streamlit. According to Pipfileimage
pyarrow is only needed for custom components. Therefore I think streamlit can run safely without it if you are not going to do anything invloving custom component creation.
So what i did was to firt get all the streamlit package dependencies and installed them (with the exception of pyarrow). You can create a requirement.txt for that. After you are done installing the dependencies, then install streamlit. Please note that installing streamlit first will try and install pyarrow which might break the installation processs especially if your pi arch is 32bit. This worked for me. Hope it works for you too

1 Like