skvadrik/re2c

Installing re2c : configure: error: no suitable Python interpreter found

Closed this issue ยท 13 comments

Hello,
I'm trying to install re2c on Mac OS El Capitan but it does not work (see the error below). It is to be noted that I have python 3.9.7 installed. ($python --version returns Python 3.9.7)

checking for a Python interpreter with version >= 3.7... none

configure: error: no suitable Python interpreter found

in my environnent I try to install re2c with automake1.16.5 and autoconf @2.69, 2.70 and 2.71 (in have the three packages in my Homebrew folder.
Thank you very much for your support.

Hi! This is a duplicate of #456.

It is an automake bug that was fixed, but not released yet (here's the upstream bug with more links: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65679).

As a workaround, you can try to pass python version as PYTHON=python3.11 ./configure.

Thank you for your answer. Could you please give more details on this ?
As a workaround, you can try to pass python version as PYTHON=python3.11 ./configure.
What is the file that needs to be modified this way? Sorry if it is very basic question

What is the file that needs to be modified this way? Sorry if it is very basic question

No worries!

How do you build re2c?

PYTHON=python3.11 ./configure is a command to configure re2c. With Autotools, one usually runs ./configure && make && make install to build and install software (there are various options, see https://re2c.org/build/build.html#build-autotools for details). PYTHON=python3.11 before the ./configure command sets an environment variable that affects the execution of ./configure so that it picks this particular version of python (of course, you need to make sure that you have python3.11 installed, or else pass any other suitable version that you have).

Note that re2c can also be built with CMake, if it makes things easier for you: https://re2c.org/build/build.html#build-cmake

I'm using brew install re2c and it does everything.
That's why I don't know where to add this modification.
Thank you very much for having to explain some obvious things

Actually I need to install re2C as a dependency of shivammathur/php/php@8.1
All this stuff is done through the command brew. It looks like a very simple thing but I don't know how to resolve the issue.
Please note that I've stored the re2c tarball and launched the .configure with the modification you have suggested and it worked.
The issue that when I try to resume the installation of php it tries again to reinstall it and I face still the same problem.
Could you please help me move forward?

Before you run the brew command in a shell, do export PYTHON=python3.11. This will hopefully propagate the variable to the shell that configures re2c. Note that this command changes the state of your shell (so all subsequent commands that you run in this shell will be affected by it too).

I've tried the export and it did not fix the issue unfortunately.
I saw that it is possible to install packages outside brew and to make a link between them something like this
cmake -DCMAKE_INSTALL_PREFIX=$(brew --prefix)/Cellar ...
and brew link package
For the moment it is not very clear to me but I will be investigating this possibility..

You can just edit the formula file to do the thing you want.

I was able to solve this issue by downloading the re2c,rb file

And changing the line uses_from_macos "python" => :build to depends_on "python" => :build

Then installing by using: brew install --formula ./re2c.rb if in same path as the flie.

Perhaps maybe opening an issue or pull request on homebrew for the re2c formula to use python from homebrew instead of macOS if they are willing to change that, but I guess macOS 10.15 and up should have python3 .7 and up by default, so not sure why it wouldn't be found. I'm still using 10.14 which doesn't have python3 by default.

This doesn't seem like an re2c bug, tbh. Maybe it should be closed.

I was able to solve this issue by downloading the re2c,rb file

And changing the line uses_from_macos "python" => :build to depends_on "python" => :build

Then installing by using: brew install --formula ./re2c.rb if in same path as the flie.

Perhaps maybe opening an issue or pull request on homebrew for the re2c formula to use python from homebrew instead of macOS if they are willing to change that, but I guess macOS 10.15 and up should have python3 .7 and up by default, so not sure why it wouldn't be found. I'm still using 10.14 which doesn't have python3 by default.

Thnak you very much for your answer. Actually my original goal was to install PHP 8 on an old MAC OS. For those who might have the same issue, just forget about brew and shivammathur/php package and use Mac ports instead. It is much easier and it works !

Closing the issue, as there are no action items for re2c here.

That's the same reason I ran into this issue for installing PHP.
Even though I finally solved every possible issue now.

But I agree after testing MacPorts that it is way superior then Homebrew after testing it in a few vm's (since i want to make sure it will work on production). Surprised it's not more recommended.