📅 2017-Jan-24 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cmake, error, python ⬩ 📚 Archive
I got this error from CMake when building a project that needs to link with Python 3.4 libraries:
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.4.3", minimum required is "3.0")
-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "3.0")
Turns out that the CMake available on my system only supported finding Python 3 packages upto version 3.3. To change it to support Python 3.4 was possible by editing two files:
In file /usr/share/cmake-3.4/Modules/FindPythonInterp.cmake
find the line containing _PYTHON3_VERSIONS
and prepend 3.4
to the versions already listed there.
In file /usr/share/cmake-3.4/Modules/FindPythonLibs.cmake
find the line containing _PYTHON3_VERSIONS
and prepend 3.4
to the versions already listed there.
I was able to build with Python 3.x libraries after that.