Home > Software engineering >  Brew installation does not find PythonInterp even when set
Brew installation does not find PythonInterp even when set

Time:05-31

I'm trying to install Sumo via Brew on Mac OS 12.4. I had it previously working, but recently uninstalled and it and now it doesn't seem to like being installed.

When I run brew install sumo, the following is the output:

Last 15 lines from /Users/behradkoohy/Library/Logs/Homebrew/sumo/01.cmake:
--     CMake: 3.23.1
--     CMake generator: Unix Makefiles
--     CMake build tool: /opt/homebrew/Library/Homebrew/shims/mac/super/gmake
--     Compiler: Clang 13.1.6.13160021
--
CMake Error at /opt/homebrew/Cellar/cmake/3.23.1_1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.23.1_1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /opt/homebrew/Cellar/cmake/3.23.1_1/share/cmake/Modules/FindPythonInterp.cmake:169 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:170 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/sumo-20220526-41647-p2rgj7/sumo-1.13.0/build/cmake-build/CMakeFiles/CMakeOutput.log".

I've tried manually defining PythonInterp/PYTHON_EXECUTABLE, but this doesn't seem to remove the error. Additionally, when I search for similar problems on Stackoverflow, they're all generally related to Make - which I'm not sure how to edit when installing through brew.

Any help would be greatly appreciated. I've tried uninstalling and reinstalling Brew to no avail as well.

CodePudding user response:

Whilst not ideal, the solution was found and is as follows:

First, I ran brew edit sumo to see what is executed when I run brew install sumo.

Somewhere in the middle of the file, there is a definition for cmake_args. I added "-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3" to this. Once this change was made, the installer no longer complained that it can't find Python_Interp.

  • Related