wooden-thailand-8386
09/24/2020, 6:28 PMpex.executor.ExecutableNotFound: caught OSError(2, 'No such file or directory') while trying to execute `[u'/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/bin/python3',fierce-france-72742
09/24/2020, 6:41 PMv2.0.0.dev9 , I would be very interested!fierce-france-72742
09/24/2020, 6:42 PMpants.toml
[python-setup]
interpreter_constraints = ["CPython>=xxx"]
interpreter_search_paths = ["<PYENV>"]
[pex]
executable_search_paths = ["<PATH>"]wooden-thailand-8386
09/24/2020, 6:44 PMfierce-france-72742
09/24/2020, 6:44 PMwooden-thailand-8386
09/24/2020, 6:48 PMhappy-kitchen-89482
09/24/2020, 6:53 PMhappy-kitchen-89482
09/24/2020, 6:54 PMhundreds-father-404
09/24/2020, 6:59 PM[python-setup]
interpreter_search_paths = ["<PYENV>"]
[pex]
executable_search_paths = ["<PATH>"]
This will tell Pex to only look at Pyenv when choosing an interpreter. Any subprocess you run will set PATH to your original PATH.
This means that even if Pex is using the right interpreter, if a subprocess spawned by Pex looks for Python interpreters, it can still choose the bad version. So it might work, but might not depending on your setuphundreds-father-404
09/24/2020, 7:00 PMinterpreter_constraints to something that avoids the problematic macOS version. For example, [">=3.7.3"] (I think the bad version is 3.7.2 iirc)
This is not good though that it’s not very portable. It’s definitely a hacky workaroundwooden-thailand-8386
09/24/2020, 7:15 PM15:13:08.20 [DEBUG] Completed: Searching for `python` on PATH=/Users/lzfnyy/.pyenv/versions/3.6.11/bin:/Users/lzfnyy/.pyenv/versions/3.7.8/bin:/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin
15:13:08.20 [DEBUG] Completed: Searching for `python` on PATH=/Users/lzfnyy/.pyenv/versions/3.6.11/bin:/Users/lzfnyy/.pyenv/versions/3.7.8/bin:/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin
15:13:08.20 [DEBUG] Completed: Find binary path - failed to find python
15:13:09.70 [DEBUG] Completed: Searching for `python3` on PATH=/Users/lzfnyy/.pyenv/versions/3.6.11/bin:/Users/lzfnyy/.pyenv/versions/3.7.8/bin:/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin
15:13:09.70 [DEBUG] Completed: Searching for `python3` on PATH=/Users/lzfnyy/.pyenv/versions/3.6.11/bin:/Users/lzfnyy/.pyenv/versions/3.7.8/bin:/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin
15:13:09.70 [DEBUG] Completed: Find binary path - failed to find python3
15:13:11.43 [DEBUG] Completed: Searching for `python2` on PATH=/Users/lzfnyy/.pyenv/versions/3.6.11/bin:/Users/lzfnyy/.pyenv/versions/3.7.8/bin:/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin
15:13:11.43 [DEBUG] Completed: Searching for `python2` on PATH=/Users/lzfnyy/.pyenv/versions/3.6.11/bin:/Users/lzfnyy/.pyenv/versions/3.7.8/bin:/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin
15:13:11.43 [DEBUG] Completed: Find binary path - failed to find python2wooden-thailand-8386
09/24/2020, 7:16 PM"<PYENV>" to my actual ~/.pyenv or do I just keep it like that <PYENV>hundreds-father-404
09/24/2020, 7:18 PM<PYENV>
Can you please confirm that $ pyenv root does the right thing for you?wooden-thailand-8386
09/24/2020, 7:21 PM/Users/lzfnyy/.pyenv to mewooden-thailand-8386
09/24/2020, 7:21 PMhundreds-father-404
09/24/2020, 7:25 PM<PYENV> is expanding correclty:
Searching … on… Users/lzfnyy/.pyenv/versions/3.6.11/bin/Users/lzfnyy/.pyenv/versions/3.7.8/bin/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin So, it sounds like the correct places are being searched, but for some reason the interpreter is not being selected 🤔
hundreds-father-404
09/24/2020, 7:26 PMwooden-thailand-8386
09/24/2020, 7:27 PM15:26:26.28 [WARN] Completed: Find PEX Python - No bootstrap Python executable could be found from the option `interpreter_search_paths` in the `[python-setup]` scope. Will attempt to run PEXes directly.wooden-thailand-8386
09/24/2020, 7:29 PMhundreds-father-404
09/24/2020, 7:32 PMpyenv global. But I don’t think that’d be relevant, as Pants looks at all the .pyenv/versions folders, which is shown by the above debug message
No such file or directoryOof. I knew macOS Python was broken, but didn’t realize it’s that broken.
wooden-thailand-8386
09/24/2020, 7:33 PMwooden-thailand-8386
09/24/2020, 7:37 PMwooden-thailand-8386
09/24/2020, 7:38 PM./pants test but I cant remember for surehundreds-father-404
09/24/2020, 7:44 PMinterpreter_search_paths to ["/Users/lzfnyy/.pyenv/versions/3.6.11/bin"]? I don’t think this will fix it because it looks like the interpreter_search_paths were expanding correctly, and that’s not the issuewooden-thailand-8386
09/24/2020, 7:45 PMhundreds-father-404
09/24/2020, 7:46 PMwooden-thailand-8386
09/24/2020, 7:46 PMhundreds-father-404
09/24/2020, 8:23 PM~/.pyenv interpreters, and they all had exit code 0 and printed a fingerprint. This means that Pants should recognize them as valid.
Further, as seen above in Thale’s debug logging, Pants is claiming to be searching all the correct folders
So I’m a little at a loss for what’s going on now. cc @witty-crayon-22786witty-crayon-22786
09/24/2020, 8:26 PMwitty-crayon-22786
09/24/2020, 8:27 PMhundreds-father-404
09/24/2020, 8:27 PMwooden-thailand-8386
09/24/2020, 8:27 PMinterpreter_constraints to >=3.8 and that actually made it work so it seems like because I have (or had) the 3.7 under my Xcode it’s trying to use ithundreds-father-404
09/24/2020, 8:28 PMwitty-crayon-22786
09/24/2020, 8:28 PMFalliablewitty-crayon-22786
09/24/2020, 8:28 PMwitty-crayon-22786
09/24/2020, 8:29 PMwooden-thailand-8386
09/24/2020, 8:30 PM16:29:02.24 [WARN] Completed: Find PEX Python - No bootstrap Python executable could be found from the option `interpreter_search_paths` in the `[python-setup]` scope. Will attempt to run PEXes directly.hundreds-father-404
09/24/2020, 8:30 PMwooden-thailand-8386
09/24/2020, 8:44 PMwitty-crayon-22786
09/24/2020, 8:57 PMwooden-thailand-8386
09/24/2020, 8:57 PMwooden-thailand-8386
09/24/2020, 8:57 PMwitty-crayon-22786
09/24/2020, 9:01 PMwitty-crayon-22786
09/24/2020, 9:01 PMwitty-crayon-22786
09/24/2020, 9:01 PMhundreds-father-404
09/24/2020, 9:02 PMwooden-thailand-8386
09/24/2020, 9:03 PM3.7 folder from inside the <http://Xcode.app/|Xcode.app/>…/Python/ to a temp folderwitty-crayon-22786
09/24/2020, 9:04 PMPATH=/Users/lzfnyy/.pyenv/versions/3.6.11/bin:/Users/lzfnyy/.pyenv/versions/3.7.8/bin:/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin command which -a pythonwooden-thailand-8386
09/24/2020, 9:04 PMhundreds-father-404
09/24/2020, 9:04 PMwooden-thailand-8386
09/24/2020, 9:04 PMwooden-thailand-8386
09/24/2020, 9:05 PMwooden-thailand-8386
09/24/2020, 9:05 PMcommand before which is that on purpose?witty-crayon-22786
09/24/2020, 9:05 PMPATH=/Users/lzfnyy/.pyenv/versions/3.6.11/bin:/Users/lzfnyy/.pyenv/versions/3.7.8/bin:/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin command -v pythonwitty-crayon-22786
09/24/2020, 9:06 PMwooden-thailand-8386
09/24/2020, 9:06 PMcommand I get:wooden-thailand-8386
09/24/2020, 9:06 PM/Users/lzfnyy/.pyenv/versions/3.6.11/bin/python
/Users/lzfnyy/.pyenv/versions/3.7.8/bin/python
/Users/lzfnyy/.pyenv/versions/3.8.1/bin/python
/Users/lzfnyy/.pyenv/versions/3.8.2/bin/pythonwooden-thailand-8386
09/24/2020, 9:06 PM/Users/lzfnyy/.pyenv/versions/3.6.11/bin/pythonwitty-crayon-22786
09/24/2020, 9:07 PMwitty-crayon-22786
09/24/2020, 9:07 PMcommand -v which ; echo $?wooden-thailand-8386
09/24/2020, 9:09 PMwhich
0witty-crayon-22786
09/24/2020, 9:12 PMwitty-crayon-22786
09/24/2020, 9:16 PM#!/usr/bin/env bash
set -euox pipefail
if command -v which > /dev/null; then
command which -a $1
else
command -v $1
fi
then marking it executable:
chmod +x find-binary.sh
then running it like:
PATH=/Users/lzfnyy/.pyenv/versions/3.6.11/bin:/Users/lzfnyy/.pyenv/versions/3.7.8/bin:/Users/lzfnyy/.pyenv/versions/3.8.1/bin:/Users/lzfnyy/.pyenv/versions/3.8.2/bin ./find-binary.sh pythonwitty-crayon-22786
09/24/2020, 9:21 PMwitty-crayon-22786
09/24/2020, 9:22 PMenv: bash: No such file or directorywooden-thailand-8386
09/24/2020, 9:22 PMenv: bash: No such file or directorywitty-crayon-22786
09/24/2020, 9:22 PMwitty-crayon-22786
09/24/2020, 9:22 PMwooden-thailand-8386
09/24/2020, 9:23 PMwitty-crayon-22786
09/24/2020, 9:23 PMwooden-thailand-8386
09/24/2020, 9:24 PMwitty-crayon-22786
09/24/2020, 9:24 PMwitty-crayon-22786
09/24/2020, 9:24 PMwitty-crayon-22786
09/24/2020, 9:25 PMwooden-thailand-8386
09/24/2020, 9:25 PMwitty-crayon-22786
09/24/2020, 9:26 PMwooden-thailand-8386
09/24/2020, 9:28 PMwooden-thailand-8386
09/24/2020, 9:28 PMwitty-crayon-22786
09/24/2020, 9:28 PMwitty-crayon-22786
09/24/2020, 9:35 PMwitty-crayon-22786
09/25/2020, 2:27 AMwitty-crayon-22786
09/25/2020, 2:28 AMfierce-france-72742
09/25/2020, 7:21 AMwitty-crayon-22786
09/28/2020, 6:29 PM2.0.0b2 was released over the weekend that should allow the
interpreter_search_path=["<PYENV>"]
solution to work herewooden-thailand-8386
09/28/2020, 7:00 PMwitty-crayon-22786
09/28/2020, 7:00 PMinterpreter_search_path set that selects just PYENV, yeawitty-crayon-22786
09/28/2020, 7:03 PMwooden-thailand-8386
09/28/2020, 7:21 PMwitty-crayon-22786
09/28/2020, 7:22 PMwooden-thailand-8386
09/28/2020, 7:22 PMwitty-crayon-22786
09/28/2020, 7:22 PMwooden-thailand-8386
09/28/2020, 7:23 PMhundreds-father-404
09/28/2020, 7:51 PMenough-analyst-54434
09/28/2020, 10:13 PMenough-analyst-54434
09/28/2020, 10:14 PMenough-analyst-54434
09/28/2020, 10:32 PM