python - Fails to build OpenCV 3 with Python2 support -
i tried build opencv 3 python back upwards (with cuda, too) ubuntu 14.04 using cmake-gui.
the compilation seems work fine until python console:
>>> import cv2 traceback (most recent phone call last): file "<stdin>", line 1, in <module> importerror: no module named cv2
i tried both python3 enabled or disabled without change. cmakecache.txt is here.
any thought prepare problem?
i had same problem since yesterday, , solved follows:
download opencv 3(beta, rc1) , install necessary dependencies, including python dev package. open cmake gui. activate grouped checkbox. select opencv source , build directories (or delete cache if configured). press configure. select preferred generator. check/uncheck options need (opengl support, tbb, etc.) if want, can press configure after every alternative modification see if fails or not. ignore python2 options now. once have configured other options, select python2 grouping , delete remove entry. press configure. python2 grouping reappear, in red. not alter more, press generate.now can make/compile usual way. cv2.so file created in build/lib/ directory. create install installed python 2.
if still not work maybe problem somewhere else. after step 8, cmake output must include lines (actual paths might different in case):
python 2: interpreter: /usr/bin/python2.7 (ver 2.7.6) libraries: /usr/lib/i386-linux-gnu/libpython2.7.so (ver 2.7.6) numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2) packages path: lib/python2.7/dist-packages
in no case there can line saying no, like:
python 2: interpreter: /usr/bin/python2.7 (ver 2.7.6) libraries: no numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2) packages path: lib/python2.7/dist-packages
hope helps.
python opencv3.0
No comments:
Post a Comment