1

I have zero knowledge of CMake. I've downloaded OpenCV 3.0.0 and I'm trying to get CMake to detect the Python 3.5 I have installed with my Anaconda 3 install. At the moment, CMake is able to detect my Python 2.7 and Python 3.4.3 that came with the Ubuntu install. How do I make CMake detect my Anaconda 3 Python 3.5 install? I don't know but it feels like it should be just a simple option that tells CMake which directory to look for Python 3, but I don't know how to do it.

I've read this question and it doesn't tell me what I'm looking for.

Community
  • 1
  • 1
Ray
  • 7,833
  • 13
  • 57
  • 91
  • Maybe [I have 2 versions of python installed, but cmake is using older version. How do I force cmake to use the newer version?](http://stackoverflow.com/questions/15291500/i-have-2-versions-of-python-installed-but-cmake-is-using-older-version-how-do) I've used the `cmake -DPYTHON_EXECUTABLE:FILEPATH=/path/to/python3.5 ...` variant in another context and it worked for me. – Florian Nov 24 '15 at 13:44
  • Thank you. Adding the `-D` option and setting the `PYTHON3_EXECUTABLE` enabled CMake to find the executable, but OpenCV still can't use Python3.5 because it can't find the Python dependencies such as Numpy. I probably need to set `PYTHON3_LIBRARY` and `PYTHON3_INCLUDE_DIR` and likely other things too. I'm not really sure what to set them to. Any ideas? – Ray Nov 24 '15 at 14:53
  • Normally just declaring `PYTHON3_EXECUTABLE` should be enough (the includes and libs are searched relative to the executable's path). I don't know about NumPy, because I can't find it in my CMake 3.2.3 installation. But if I look in [FindNumPy.cmake on other GitHub forks](https://github.com/Eyescale/CMake/blob/master/FindNumPy.cmake) it seems to depend on `PYTHON_EXECUTABLE` variable (without the the `3`). If you don't really need NumPy, could you update to the latest CMake 3.4 version and try again? – Florian Nov 25 '15 at 09:23

0 Answers0