Can't install Streamlit on Ubuntu 20.04 (running under WSL 2.0) on a Surface Pro X

Hi all,

I’ve been trying to install Streamlit for a while now on a Surface Pro X running Ubuntu 20.04 LTS on WSL2.0 without success.

The problem always occurs when attempting to build wheels for pyarrow which happens as part of the streamlit installation. My process is as follows:

  • Clean install of Ubuntu 20.04 LTS
  • sudo apt-get install python3-pip
  • sudo apt-get install python3-venv
  • Create and activate new environment
  • pip3 install wheel (tried both with and without this command)
  • pip3 install streamlit

This then goes through installing all the packages it needs until it get to pyarrow-2.0.0, it then pauses for a while on ‘Installing Build Dependencies’ before giving a long screed of errors finishing with

ERROR: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly.

Looking further up the error chain I also see:

running build_ext
creating /tmp/pip-install-3z5ztsz0/pyarrow/build/temp.linux-aarch64-3.8
– Running cmake for pyarrow
cmake -DPYTHON_EXECUTABLE=/home/he/envs/jupyter/bin/python3 -DPython3_EXECUTABLE=/home/he/envs/jupyter/bin/python3 -DPYARROW_BUILD_CUDA=off -DPYARROW_BUILD_FLIGHT=off -DPYARROW_BUILD_GANDIVA=off -DPYARROW_BUILD_DATASET=off -DPYARROW_BUILD_ORC=off -DPYARROW_BUILD_PARQUET=off -DPYARROW_BUILD_PLASMA=off -DPYARROW_BUILD_S3=off -DPYARROW_BUILD_HDFS=off -DPYARROW_USE_TENSORFLOW=off -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_BOOST=off -DPYARROW_GENERATE_COVERAGE=off -DPYARROW_BOOST_USE_SHARED=on -DPYARROW_PARQUET_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /tmp/pip-install-3z5ztsz0/pyarrow
error: command ‘cmake’ failed with exit status 1

ERROR: Failed building wheel for pyarrow

I’ve been trawling the Streamlit and pyarrow forums for a while now and have tried various solutions including --no-binary, --no-pep-517 and explicity passing the architecture to the cmake build command. However to be blunt I don’t understand what these commands are doing so its difficult for me to systematically troubleshoot the issue so I turn to the community for help.

Streamlit installs perfectly on my standard x64 intel windows system, is this a problem with the Pro X running an ARM architecture? If so how can I workaround this? I know from my forum trawling that Streamlit has been successfully installed on RPi 4’s using ARM processors so I think there’s just something I’m missing.

Hey @Helios210,

First, Welcome to the Streamlit community!!! :tada: :tada: :partying_face: :tada: :partying_face:

Next have you tried using conda? Sometimes pyarrow and pip don’t like each other! (got this from Randy’s post on this question)

try conda install -c conda-forge streamlit

Also, what’s your python version (is it 3.9)?

Let me know how this goes,
Marisa

Hi Marisa,

Thanks for the reply, unfortunately conda is not supported on aarch64 systems (the Surface Pro X uses an ARM processor). It looks like it would need to be built from source.

Perhaps the same is true of pyarrow/streamlit? The only odd bit being that folks have managed to get it running on ARM-based Pi systems, so that gave me a bit of hope that it could be done here also.

Okay so thanks to the great work by the folks over at Miniforge who compiled a Linux ARM64 version of miniconda I got this working!

For others using a Surface Pro X, and, assuming you’ve already setup WSL 2.0 and installed Ubuntu 20.04 LTS from the Windows Store, do the following:

  1. Decide which version you want from the above link and download it, so for the current standard install use:

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

  1. Execute the file using:

bash Miniforge3-Linux-aarch64.sh # (or the file you downloaded)

  1. Create conda environment

conda create --name yourenvname

  1. Install streamlit

conda install -c conda-forge streamlit

  1. Test streamlit

streamlit hello

  1. Open the web address it gives you which is accessible through a browser from within your Win 10 instance.

Done!

Thanks for the nudge in the right direction Marisa, I avoided using conda in the past because it always screwed up my pip package installations but with miniconda-forge and the fact it wraps pip into the environments it creates this should be a thing of the past!

2 Likes

YAY!!! :nerd_face: :partying_face: :tada:

I am so glad you got everything working! I’m super happy I was at least able to point you in the right direction :smiling_face_with_three_hearts:

ALSO! Kudos on the excellent explanation of your steps (with links!! :star_struck:) on how you solved this problem!!! This will end up being a valuable resource for anyone else who comes across this hiccup!

Can’t wait to see what you build,
Happy Streamlit-ing!
Marisa

1 Like