Ask Your Question
0

OpenCV installation error: SyntaxError related to python

asked 2017-03-26 11:17:55 -0600

jrbent gravatar image

Hi, I am trying to install openCV on a remote server, and I keep getting hung up at this error at 98% after running make.

Here is my cmake command

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/jbent1/local/opencv-master -DWITH_IPP=OFF -D WITH_LAPACK=OFF -D BUILD_PYTHON_SUPPORT=ON -D PYTHON3_EXECUTABLE=/home/jbent1/local/python/bin/python3 -D PYTHON3_LIBRARIES=/home/jbent1/local/python/lib/libpython3.4m.a -D PYTHONINTERP_FOUND=1 ..

The error message:

    Linking CXX shared library ../../lib/libopencv_videostab.so
[ 98%] Built target opencv_videostab
[ 98%] Generating pyopencv_generated_include.h, pyopencv_generated_funcs.h, pyopencv_generated_types.h, pyopencv_generated_type_reg.h, pyopencv_generated_ns_reg.h
Traceback (most recent call last):
  File "/home/jbent1/local/opencv-master/modules/python/python2/..//src2/gen2.py", line 4, in <module>
    import hdr_parser, sys, re, os
  File "/home/jbent1/local/opencv-master/modules/python/src2/hdr_parser.py", line 855
    has_mat = len(list(filter(lambda x: x[0] in {"Mat", "vector_Mat"}, args))) > 0
                                                      ^
SyntaxError: invalid syntax
make[2]: *** [modules/python2/pyopencv_generated_include.h] Error 1
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
make: *** [all] Error 2

Any help would be greatly appreciated, as I am totally confused by this. Thanks

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2018-03-16 13:51:19 -0600

error like this

  [ 98%] Building CXX object modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o
In file included from /home/pi/opencv-3.4.1/modules/python/src2/cv2.cpp:1743:0:
/home/pi/opencv-3.4.1/release/modules/python_bindings_generator/pyopencv_generated_ns_reg.h:1689:1: error: narrowing conversion of ‘(cv::Mat::._240)4294901760u’ from ‘unsigned int’ to ‘long int’ inside { } [-Wnarrowing]
 };
 ^
/home/pi/opencv-3.4.1/release/modules/python_bindings_generator/pyopencv_generated_ns_reg.h:1689:1: error: narrowing conversion of ‘(cv::Mat::._240)4294901760u’ from ‘unsigned int’ to ‘long int’ inside { } [-Wnarrowing]
/home/pi/opencv-3.4.1/release/modules/python_bindings_generator/pyopencv_generated_ns_reg.h:1689:1: error: narrowing conversion of ‘(cv::SparseMat::._243)2147483648u’ from ‘unsigned int’ to ‘long int’ inside { } [-Wnarrowing]
/home/pi/opencv-3.4.1/release/modules/python_bindings_generator/pyopencv_generated_ns_reg.h:1689:1: error: narrowing conversion of ‘(cv::SparseMat::._243)2147483648u’ from ‘unsigned int’ to ‘long int’ inside { } [-Wnarrowing]
/home/pi/opencv-3.4.1/release/modules/python_bindings_generator/pyopencv_generated_ns_reg.h:1689:1: error: narrowing conversion of ‘(cv::UMat::._242)4294901760u’ from ‘unsigned int’ to ‘long int’ inside { } [-Wnarrowing]
/home/pi/opencv-3.4.1/release/modules/python_bindings_generator/pyopencv_generated_ns_reg.h:1689:1: error: narrowing conversion of ‘(cv::UMat::._242)4294901760u’ from ‘unsigned int’ to ‘long int’ inside { } [-Wnarrowing]
In file included from /home/pi/opencv-3.4.1/modules/python/src2/cv2.cpp:1743:0:
/home/pi/opencv-3.4.1/release/modules/python_bindings_generator/pyopencv_generated_ns_reg.h:2133:1: error: narrowing conversion of ‘(cv::ocl::Device::._265)4294967295u’ from ‘unsigned int’ to ‘long int’ inside { } [-Wnarrowing]
 };
 ^
/home/pi/opencv-3.4.1/release/modules/python_bindings_generator/pyopencv_generated_ns_reg.h:2133:1: error: narrowing conversion of ‘(cv::ocl::Device::._265)4294967295u’ from ‘unsigned int’ to ‘long int’ inside { } [-Wnarrowing]
modules/python2/CMakeFiles/opencv_python2.dir/build.make:62: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o' failed
make[2]: *** [modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o] Error 1
CMakeFiles/Makefile2:7836: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/all' failed
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-03-26 11:17:55 -0600

Seen: 1,420 times

Last updated: Mar 26 '17