Saad
Saad

Reputation: 933

Building OpenCV libraries from source files

I have installed Python 2.7, but when I try to generate the OpenCV 2.3.1 project Makefiles using CMake 2.8, I get the following message. I am running Windows 7 x86 and using Visual Studio 10.

Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE) 
Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) 

I have followed the guide provided at this link.

Upvotes: 9

Views: 14150

Answers (3)

Baris Demiray
Baris Demiray

Reputation: 1607

Check the architecture of your installed Python, in my case for example I had Python x86_64 package installed but Cmake was looking for x86. So I believe this Cmake error message has a great potential of improvement.

Upvotes: 1

ala
ala

Reputation: 141

Yes, this also worked for me.

Check advanced, then manually set the values for the three variables.

In my case:

PYTHON_EXECUTABLE = .../python.exe

PYTHON_INCLUDE_DIR = .../include

PYTHON_LIBRARY = .../python26.lib

Tested with PythonPortable on Windows. (so, no installation required)

Upvotes: 14

Martin Beckett
Martin Beckett

Reputation: 96147

Did you install Python in the normal place ( c:\Python2.7 on windows)

Use the Cmake-gui select advanced and it will allow you to set all the values directly

Upvotes: 3

Related Questions