title: Compiling OpenCV: how to build the cv2.so module for python3.6?
body: <p>I have been struggling with compiling OpenCV for a while. The system is Linux Ubuntu 16.10.</p>
  
  <p>Unfortunately it seems that the only library binding / module for Python that is being compiled is the one for Python 2.7, that gets installed at this location: </p>
  
  <pre><code>/usr/local/lib/python2.7/dist-packages/cv2.so
  </code></pre>
  
  <p>What I need instead is <code>cv2</code> for <code>python3.6</code>.
  I have set up the link <code>/usr/bin/python</code> to point to <code>/usr/bin/python3.6</code> .</p>
  
  <p>this is my <code>cmake</code> directive:</p>
  
  <pre><code>cmake \                                                                                   
  -D CMAKE_BUILD_TYPE=RELEASE \                                                         
  -D CMAKE_INSTALL_PREFIX=/usr/local \                                                  
  -D BUILD_NEW_PYTHON_SUPPORT=ON \                                                      
  -D INSTALL_C_EXAMPLES=ON \                                                            
  -D INSTALL_PYTHON_EXAMPLES=ON \                                                       
  -D BUILD_EXAMPLES=ON \                                                                
  -DENABLE_PRECOMPILED_HEADERS=OFF \                                                    
  -D OPENCV_EXTRA_MODULES_PATH=/home/foobar/Downloads/opencv_contrib/modules \
  ..         
  </code></pre>
  
  <p>any idea on what might be going wrong?</p>