I broke my PHP installation on MacOS Mojave, so I'm trying:
brew reinstall shivammathur/php/php@7.4
This goes well until reaching re2c
:
==> Installing shivammathur/php/php@7.4 dependency: re2c
which fails with:
checking for a Python interpreter with version >= 3.7... none
configure: error: no suitable Python interpreter found
This is very odd, because python is installed and has multiple versions that should pass:
~$ which python
/usr/local/bin/python
~$ python --version
Python 3.11.4
~$ python3 --version
Python 3.11.4
~$ python3.9 --version
Python 3.9.17
Digging through the config.log
of re2c
, I find a lot of failed checks:
...
configure:3672: checking for a Python interpreter with version >= 3.7
configure:3690: python -c import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3.7'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)
configure:3693: $? = 1
configure:3690: python2 -c import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3.7'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)
./configure: line 3691: python2: command not found
configure:3693: $? = 127
configure:3690: python3 -c import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3.7'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)
./configure: line 3691: python3: command not found
configure:3693: $? = 127
configure:3690: python3.9 -c import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3.7'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)
./configure: line 3691: python3.9: command not found
...
It seems that the python
command executes, but fails the check, while python3
and python3.9
return command not found
.
How can this be if my shell clearly thinks otherwise?
Thank you for any suggestions!!