Hi everyone I need some help with running pex targ...
# general
b
Hi everyone I need some help with running pex target For some reason running the python target works but pex doesnt Looks like when running pex, pants does install the correct python at the correct location(my custom cache dir) but when its trying to build the pex file it doesnt look there, instead it is looking at the default locations I'm using Macbook pro M4 and my colleague has the same but it does work for him I did fumble a bit the installation, maybe it has something to do with it, I installed using
curl
and after that installed using
brew
, now I have uninstalled the
brew
version Here is a simple project that creates this issue for me: *pants.to*ml
Copy code
[GLOBAL]
pants_version = "2.24.1"
backend_packages = [
    "pants.backend.python",
    "pants.backend.python.providers.experimental.pyenv",
]
named_caches_dir = '.pants-cache'

[source]
root_patterns = [
    "/"
]

[python]
interpreter_constraints = ["==3.7.*"]
BUILD
Copy code
python_sources(
    name="root",
)
pex_binary(
    name='pex',
    entry_point='script',
    interpreter_constraints=['==3.7.*'],
)%
script.py
Copy code
import sys
print(f'hello world, I am {sys.version} @ {sys.executable}')
I'm running python target like this:
pants run :root
- works great And the pex target like this:
pants run :pex
- gives me the following error:
Copy code
16:29:36.96 [INFO] Completed: Building pex.pex
16:29:36.96 [ERROR] 1 Exception encountered:

Engine traceback:
  in `run` goal

ProcessExecutionFailure: Process 'Building pex.pex' failed with exit code 1.
stdout:

stderr:
Could not find a compatible interpreter.

Examined the following interpreters:
1.)           /opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/bin/python3.13 CPython==3.13.2
2.) /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 CPython==3.9.6

No interpreter compatible with the requested constraints was found:

  Version matches CPython==3.7.*
I need some guidance on where can the issue be because I tried looking at the docs and sandboxes and couldnt find whats wrong Can anyone help?
d
b
Thanks Yeah it looks similar but not sure if it is My issue is not consistent, for my colleague who has the exact same mac it does work