Marc43
Marc43

Reputation: 491

Is there a way to install Python for ARM in a amd64 architecture?

I am trying to cross compile an application for arm that depends on Python2.7 headers, but as you may understand, I don't have these headers and I don't know where nor how obtain them. I tried doing something like:

sudo apt install libpython2.7-dev:armhf

But it didn't work, it can't find the package. I saw another question like this but the answer were that this isn't possible as it is a conflict (both binaries are named Python and so on...), but it is? I just want the headers which are going to be in /usr/arm-linux-gnueabihf/include , what's the problem with that?

Also, is possible that I am wrong thinking that the solution for my problem is to install the headers, the error is the following:

/usr/include/python2.7/pyconfig.h:24:54: fatal error: arm-linux-gnueabihf/python2.7/pyconfig.h: No such file or directory
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

Any other ideas than mine?

Thank you very much, Marc

Upvotes: 2

Views: 6320

Answers (1)

Florian Weimer
Florian Weimer

Reputation: 33757

You need to invoke

dpkg --add-architecture armhf
apt update

before you can install packages of a foreign architecture. With these additional steps, I can install libpython2.7-dev:armhf on Debian stretch, but I have not verified if this actually works for compiling anything.

Upvotes: 3

Related Questions