<#18683 /usr/bin/env: &lt;python-version&gt; No su...
# github-notifications
c
#18683 /usr/bin/env: &lt;python-version&gt; No such file or directory when using adhoc_tool runnable is pex_binary Issue created by cburroughs Describe the bug
Copy code
python_source(
    name='lib-hello',
    source='hello.py')

pex_binary(
    name="hi",
    entry_point="hello.py",
)

adhoc_tool(
    name="local-data",
    runnable=":hi",
    args=["--foo"],
    output_directories=["data"],
    log_output=True,
)

python_source(
    name='lib-world',
    source='world.py',
    dependencies=[':local-data']
)
Results in
Copy code
$ pants --keep-sandboxes=on_failure run hello_pex/world.py 
17:07:27.22 [INFO] Preserving local process execution dir /tmp/pants-sandbox-LcNOLX for Running the `adhoc_tool` at hello_pex:local-data
17:07:27.22 [INFO] Completed: Running the `adhoc_tool` at hello_pex:local-data
17:07:27.22 [ERROR] 1 Exception encountered:

Engine traceback:
  in `run` goal

ProcessExecutionFailure: Process 'the `adhoc_tool` at hello_pex:local-data' failed with exit code 127.
stdout:

stderr:
/usr/bin/env: 'python3.9': No such file or directory
Confusingly, the
__run.sh
from the sandbox runs without error when invoked directly. so I'm not sure what is going on here. Pants version 2.16.0a0, 2.16.0rc0 OS Linux Additional info https://github.com/cburroughs/example-adhoc/tree/ad-hoc-pex pantsbuild/pants