简体   繁体   中英

Python3 Opencv3 Ubuntu 15 - make error

I ran into a quiet weird situation ...
Currently I try to build and install OpenCv3 for Python3 on Ubuntu 15
While compiling and installing opencv3 for python2.7 worked pretty well - doing the same for python3 (same downloaded opencv package) stops with make error 2 (actually with different errors) ...

So something's wrong with: [ 77%] Generating photo+CalibrateCRF.java, photo.cpp because afterwards I get different traceback's and errors:

Traceback (most recent call last):
  File "/media/stefan/A050780B5077E706/_raspi/opencv/sources/modules/java/generator/gen_java.py", line 1559, in <module>
    generator.gen(srcfiles, module, dstdir)
  File "/media/stefan/A050780B5077E706/_raspi/opencv/sources/modules/java/generator/gen_java.py", line 1061, in gen
    self.gen_class(ci)
  File "/media/stefan/A050780B5077E706/_raspi/opencv/sources/modules/java/generator/gen_java.py", line 1460, in gen_class
    for fi in ci.getAllMethods():
  File "/media/stefan/A050780B5077E706/_raspi/opencv/sources/modules/java/generator/gen_java.py", line 824, in getAllMethods
    result.extend([fi for fi in sorted(self.methods) if fi.isconstructor])
TypeError: unorderable types: FuncInfo() < FuncInfo()
modules/java/CMakeFiles/opencv_java.dir/build.make:86: recipe for target 'modules/java/photo+CalibrateCRF.java' failed
make[2]: *** [modules/java/photo+CalibrateCRF.java] Error 1
CMakeFiles/Makefile2:6282: recipe for target 'modules/java/CMakeFiles/opencv_java.dir/all' failed
make[1]: *** [modules/java/CMakeFiles/opencv_java.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

Obviously there is something going on with the java part of OpenCV. I ran into exactly the same error but since I didn't want to use Java at all I excluded it from the build and everything worked just fine.

Here is what did the job for me:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") -D BUILD_EXAMPLES=ON -D PYTHON_EXECUTABLE=$(which python3) -D BUILD_opencv_java=OFF BUILD_opencv_test_java=OFF ..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM