famous-architect-76219
01/26/2023, 1:05 PMpydantic
library.
I'm building locally PEX with the following snippet in the BUILD and it is running fine on my laptop:
pex_binary(
name="pydantic-cli",
entry_point="main.py",
dependencies=[
"projects/py/project_2:poetry#pydantic",
]
)
Now I'm trying to pack this PEX into the Docker, so I've added the following snippet to the BUILD
docker_image(
name="pydantic-cli-docker",
dependencies=[
":pydantic-cli",
]
)
I'm able to pack
the docker image, but when I'm running the container it fails:
Failed to find compatible interpreter on path /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.
Examined the following interpreters:
1.) /usr/local/bin/python3.9 CPython==3.9.16
No interpreter compatible with the requested constraints was found:
A distribution for pydantic could not be resolved for /usr/local/bin/python3.9.
Found 2 distributions for pydantic that do not apply:
1.) The wheel tags for pydantic 1.10.4 are cp39-cp39-macosx_10_9_x86_64 which do not match the supported tags of /usr/local/bin/python3.9:
cp39-cp39-manylinux_2_28_aarch64
... 304 more ...
2.) The wheel tags for pydantic 1.10.4 are cp39-cp39-macosx_11_0_arm64 which do not match the supported tags of /usr/local/bin/python3.9:
cp39-cp39-manylinux_2_28_aarch64
... 304 more ...
Now pydantic
is coming with pre-compiled binaries in the wheel, but for some reason it finds them incompatible.
Note: My laptop is M1 Macbook
I would like to be able to debug such scenarios alone, but I'm not sure where to start here, please advise.enough-analyst-54434
01/26/2023, 1:14 PMenough-analyst-54434
01/26/2023, 1:15 PMenough-analyst-54434
01/26/2023, 1:16 PMenough-analyst-54434
01/26/2023, 1:21 PMenough-analyst-54434
01/26/2023, 1:24 PMfamous-architect-76219
01/26/2023, 1:26 PMfamous-architect-76219
01/26/2023, 1:36 PMpex_binary
the complete_platforms
- but what should be the value there? According to documentation it should be "The platforms the built PEX should be compatible with."famous-architect-76219
01/26/2023, 1:49 PMfile
in BUILD:
file(
name="linux",
source="python3.9-complete-platform.json"
)
Next use it in the `complete_platforms`:
pex_binary(
name="pydantic-cli",
entry_point="main.py",
dependencies=[
"projects/py/project_2:poetry#pydantic",
],
complete_platforms=[
":linux"
]
)
curved-television-6568
01/26/2023, 2:41 PMJosh Reed
๐ )famous-architect-76219
01/26/2023, 4:59 PMcurved-television-6568
01/28/2023, 2:07 PM