python - Fails to build OpenCV 3 with Python2 support -
i tried build opencv 3 python support (with cuda, too) ubuntu 14.04 using cmake-gui.
the compilation seems work fine until python console:
>>> import cv2 traceback (most recent 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 idea fix 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 option modification see if fails or not. ignore python2 options now.
- once have configured other options, select python2 group , delete remove entry.
- press configure. python2 group reappear, in red. not change more, press generate.
now can make/compile usual way. cv2.so file created in build/lib/ directory. make 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.
Comments
Post a Comment