Hi guys, I’m encountering this error message while...
# general
l
Hi guys, I’m encountering this error message while run
pants package ::
Copy code
#10 3.101 Failed to find compatible interpreter on path /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.
#10 3.101 
#10 3.101 Examined the following interpreters:
#10 3.101 1.) /usr/local/bin/python3.10 CPython==3.10.12
#10 3.101 2.)        /usr/bin/python2.7 CPython==2.7.16
#10 3.101 3.)        /usr/bin/python3.7 CPython==3.7.3
#10 3.101 
#10 3.101 No interpreter compatible with the requested constraints was found:
#10 3.101 
#10 3.101   A distribution for sqlalchemy could not be resolved for /usr/local/bin/python3.10.
#10 3.101   Found 1 distribution for sqlalchemy that do not apply:
#10 3.101   1.) The wheel tags for SQLAlchemy 1.4.27 are cp310-cp310-macosx_12_0_arm64 which do not match the supported tags of /usr/local/bin/python3.10:
#10 3.101   cp310-cp310-manylinux_2_28_aarch64
#10 3.101   ... 333 more ...
#10 ERROR: executor failed running [/bin/sh -c PEX_TOOLS=1 python ./dist/archipelago/cli.pex venv --compile ./bin/archipelago]: exit code: 1

#14 [builder-related-titles 5/5] RUN PEX_TOOLS=1 python ./dist/related-titles/cli.pex venv --compile ./bin/related-titles
#14 sha256:afd1cf7d9539bac05b89139b28d2d0e8f177f27274e96599426c7b30cf58fca8
#14 CANCELED
------
 > [builder-archipelago 5/5] RUN PEX_TOOLS=1 python ./dist/archipelago/cli.pex venv --compile ./bin/archipelago:
------
executor failed running [/bin/sh -c PEX_TOOLS=1 python ./dist/archipelago/cli.pex venv --compile ./bin/archipelago]: exit code: 1
Seems like it’s caused by an incompatible interpreter, so I changed the pants.toml to use another python version:
Copy code
[python]
enable_resolves = true
interpreter_constraints = ["CPython==3.10.*"]

[python-bootstrap]
search_path = ["<PYENV>"]
there is a 3.10.12 version of python in
$(pyenv root)/versions
But I’m still getting the same error, pants is not using <PYENV> as python search path. Anyone has idea about this error? Thanks!
b
That looks like error logging from within a docker image build. Is that the case? If so, the error is talking about a PEX that has a “cp310-cp310-macosx_…_arm64” wheel (meaning it was build for CPython 3.10 on Apple Silicon macOS), but I imagine the docker image being built is Linux: hence incompatible 💥 You’ll need to make sure the PEX contains appropriate Linux wheels. https://github.com/pantsbuild/pants/discussions/18756 might be of interest to you
l
Oh yes, thanks for your answer! Appreciate !