2

The following is my error upon compiling:

CMake Error at /Applications/CMake.app/Contents/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find PythonInterp: Found unsuitable version "2.7.16", but
  required is at least "3" (found /usr/bin/python)
Call Stack (most recent call first):
  /Applications/CMake.app/Contents/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:456 (_FPHSA_FAILURE_MESSAGE)
  /Applications/CMake.app/Contents/share/cmake-3.18/Modules/FindPythonInterp.cmake:169 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  3rdparty/pybind11/tools/FindPythonLibsNew.cmake:60 (find_package)
  3rdparty/pybind11/tools/pybind11Tools.cmake:16 (find_package)
  3rdparty/pybind11/CMakeLists.txt:33 (include)

How to change the directory where CMake looks for python?

Gordon
  • 21
  • 1
  • 5

1 Answers1

1

As mentioned in https://cmake.org/cmake/help/v3.18/module/FindPython.html. To find python interpreter you can use:

find_package (Python COMPONENTS Interpreter Development)

This module looks preferably for version 3 of Python. If not found, version 2 is searched. To manage concurrent versions 3 and 2 of Python, use FindPython3 and FindPython2 modules rather than this one.

If it does not work. You can set:

Python_EXECUTABLE

    The path to the interpreter.
Python_COMPILER

    The path to the compiler.
Python_DOTNET_LAUNCHER

    The .Net interpreter. Only used by IronPython implementation.
Python_LIBRARY

    The path to the library. It will be used to compute the variables Python_LIBRARIES, Python_LIBRAY_DIRS and Python_RUNTIME_LIBRARY_DIRS.
Python_INCLUDE_DIR

    The path to the directory of the Python headers. It will be used to compute the variable Python_INCLUDE_DIRS.
Python_NumPy_INCLUDE_DIR

    The path to the directory of the NumPy headers. It will be used to compute the variable Python_NumPy_INCLUDE_DIRS.

As mentioned in the same page.

yflelion
  • 1,698
  • 2
  • 5
  • 16
  • Hi thanks for your answer but I have since found a solution on another stack overflow thread. I have flagged my question as a duplicate accordingly and it is pending approval. Thanks again for your input. – Gordon Nov 05 '20 at 03:41