Hi there, I'm trying to create a pex for raspberry...
# general
p
Hi there, I'm trying to create a pex for raspberry pi, and doesn't seems to succeed.. got confused with all the platform wheel flags, but trying to pex f.e numpy, and it always put inside numpy-1.21.6-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl, how can I make sure when I create a pex all the dependencies will be able to run there?
b
Can you please provide more info? • What command(s) are you running? • Whats the output? • What is the expected result?
p
I actually don't have the exact commands I've used..
but I'm trying for example to create a pex with numpy, but and it put in the zip numpy-...whl, Is PEX always put within the whl? I'm not sure how to create a PEX that will run in a different architecture (raspberry pi)
b
You can use PEX to package different architectures. You might look into playing around with the options documented in
pex --help
.
--platform
--complete-platform
and
--manylinux
seem like good candidates for experimentation
p
Yes, I've seen the help the the platform. but not sure what to provide, and the difference between them:O is it possible ask an example for creating a pex for ARM f.e ?
b
https://pypi.org/project/numpy/1.21.6/#files might be an inspiration of what to pass to
--platform
So something like
--platform=manylinux_2_17_aarch64-cp-3.8.12-cp38
? Don't quote me on that, I'm just using my
--platform
for my machine and trying to substitute values I see on that page
p
I've tried f.e pex --platform arm-cp-37-cp37m --python python3.7 numpy -o a.pex
but there's no wheel for that, isn't possible to use the source dist.?
b
I dont' think
arm
is a valid PEP-427 platform tag
aarch64
is
p
still not working
b
And excuse my naivety but https://en.wikipedia.org/wiki/AArch64 makes me think
aarch64
is the 64-bit ARM archectecture?
You likely need to pass a
platform
which matches this wheel: numpy-1.21.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
p
just a second;x
thank you, it did worked for the numpy, but then a package I'm trying to get need a specific version which only .tar.gz exists (no wheels)
it seems to fail because it couldn't resolved
(using
pex --platform linux-aarch64-cp-37-cp37m --python python3.7 pyrsistent==0.14.11 -o a.pex
)
h
Yeah, so if you use
--platform
, then you must have prebuilt
.whl
files for each distribution you use. That is because Python does not support cross-compiling, like building a Linux wheel for NumPy from macOS. That's a generic Python limitation, not Pex or Pants Are you running Pex from the Raspberry Pi, or from a foreign platform?