Opentrons / buildroot

The Opentrons fork of buildroot for building the OT2 system. Our default branch is opentrons-develop.
http://buildroot.org
Other
10 stars 7 forks source link

Investigate piwheels.org to let users install non-pure Python packages #139

Open SyntaxColoring opened 3 years ago

SyntaxColoring commented 3 years ago

Our root partition is apparently very low on space (Opentrons/opentrons#8184).

Some of our space is currently wasted on big packages like pandas (#61). We don't actually need pandas in the root partition; we include it there because users sometimes need it, and it's prohibitively difficult for them to pip install on their own to the big user partition. pip install fails because of some combination of the package depending on native libraries, and requiring a working compiler.

Instead of us continuing to keep packages like this in our root partition, we might be able to get pip install to work by configuring pip to use https://www.piwheels.org/, a community-maintained repository of Python wheel builds specifically for the Raspberry Pi.

binfordn commented 2 years ago

I did a test with two packages that have native dependencies: sila2 and scipy.

The packages and their dependencies installed successfully. However, I got errors when trying to actually use the packages. It looks like some shared library files are still unable to be found:

from sila2.client import SilaClient
(Traceback...)
ImportError: libxslt.so.1: cannot open shared object file: No such file or directory
from sila2.discovery import SilaDiscoveryBrowser
(Traceback...)
ImportError: /lib/libc.so.6: version `GLIBC_2.33' not found (required by /var/user-packages/usr/lib/python3.7/site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so)
import scipy
(Traceback...)
ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory
SyntaxColoring commented 2 years ago

Hmm, thanks for testing that.

Just having skimmed those error messages (and not having done any real investigation on this, so take this with a grain of salt), the libc error looks concerning. I wonder if we're on musl whereas piwheels is assuming glibc, or something. If so, we might be able to work around that with buildroot changes.

But the fundamental underlying problem that that would point to is piwheels explicitly being specifically for Raspberry Pi OS, whereas we are definitely not running Raspberry Pi OS.

The repository at piwheels.org does not support Ubuntu or other distributions. It's possible some wheels will work on other distributions, but we can't promise that they will. Wheels are built against certain shared libraries which we know are available to Raspberry Pi OS users too.