简体   繁体   English

如何与PIP交叉编译Python包?

[英]How to cross compile Python packages with PIP?

Is it possible to cross-compile Python packages using PIP? 是否可以使用PIP交叉编译Python包?

I'm trying to install several Python packages containing significant portions of C/C++ (scipy/numpy/matplotlib/pynacl) on a Raspberry Pi. 我正在尝试在Raspberry Pi上安装几个包含大量C / C ++(scipy / numpy / matplotlib / pynacl)的Python包。 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. 在x86机器上安装这些软件包的时间不到一分钟,但由于Pi功能不足,并且ARM没有预编译的二进制软件包,因此需要花费几个小时来编译和安装所有软件包。

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? 反正有没有在x86机器上编译和安装这些软件包到一个特殊的virtualenv,但是针对ARM平台,然后将virtualenv rsync到Pi上? Both the Pi and x86 are running Ubuntu 16. Pi和x86都运行Ubuntu 16。

Take a look at proot. 看看proot。 It is made for such things as you describe: 它是为你描述的事情而制作的:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM