Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cross compile Python packages with PIP?

Is it possible to cross-compile Python packages using PIP?

I'm trying to install several Python packages containing significant portions of C/C++ (scipy/numpy/matplotlib/pynacl) on a Raspberry Pi. Installing these packages on an x86 machine takes under a minute, but because the Pi is so underpowered, and there are no pre-compiled binary packages for ARM, it takes the Pi a couple hours to compile and install everything.

Is there anyway to compile and install these packages into a special virtualenv on an x86 machine, but targeting the ARM platform, and then rsync the virtualenv onto the Pi? Both the Pi and x86 are running Ubuntu 16.

like image 661
Cerin Avatar asked Nov 07 '22 20:11

Cerin


1 Answers

Take a look at proot. It is made for such things as you describe:

https://proot-me.github.io/

like image 163
ryeager Avatar answered Nov 14 '22 22:11

ryeager