Issue
I am using CMake. I want to link Python3 libraries to my project. I installed Python3 by homebrew, and write CMakeLists.txt
like this:
find_package(PythonLibs 3.6 REQUIRED)
But then it gave me an error:
Could NOT find PythonLibs: Found unsuitable version "2.7.10", but required
is at least "3.6" (found /usr/lib/libpython2.7.dylib)
This error happens on Mac OS X. Could anybody tell me how to solve it? Thanks.
Solution
I have solved this problem so I am answering this question by myself.
Python installed by Homebrew cannot be found by CMake. However, you can build Python from source and make install it, then CMake can find this.
Answered By - Yuheng Zou