Installing openCV at WebFaction with Python2.5

Just to follow up on my earlier post about building openCV on a Mac (Leopard), here are some notes for installing openCV 2.1 at WebFaction to default to using Python 2.5 (rather than 2.7).

The wiki guide to use cmake didn’t quite work, I went ahead with ccmake (the command-line GUI equivalent):

ccmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/ianozsvald -D BUILD_PYTHON_SUPPORT=ON ..

Next I moved through the menu to set:

  • BUILD_EXAMPLES ON
  • INSTALL_C_EXAMPLES ON
  • INSTALL_PYTHON_EXAMPLES ON

Next I used ‘t’ to turn on advanced options and configued:

  • PYTHON_EXECUTABLE=/usr/local/bin/python2.5
  • PYTHON_INCLUDE_DIR=/usr/local/include/python2.5
  • PYTHON_LIBRARY=/usr/local/lib/libpython2.5.so

To finish I used ‘c’ to create settings and ‘g’ to generate setup files. Now ‘make’ and ‘make install’ did their job (it took 10 minutes to compile). In ‘~/bin’ I saw ‘opencv_createsamples’ which shows that openCV built ok.

Finally I copied the build directory’s lib/cv.so to ‘~/lib/’ and then in python2.5 I tried ‘import cv’ and it worked. In the build directory’s ‘~/bin’ I ran ‘./cxcoretest’ and all tests passed.

Comments are disabled for this post