Still Unspecified error when reinstalling gtk2.0 and opencv3.2

asked 2017-10-13 00:37:52 -0600

cklmnhzve gravatar image

updated 2017-10-13 02:08:34 -0600

Hi, I am confused about that I can't use some functions in Python. When I call the imshow() in C++, it works without any error. However, when I use python calling imshow, the error occurs as follow:

*Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage*

However,I have already installed libgtk2.0-dev and pkg-config. So I rebuilt opencv as official tutorials again with some information on the console:

As a result , I met the error again. Now I really have no idea about my errors. Could you please give some advice? Thank you very much. And my python version is about 2.7 and Ubuntu is 14.04 I am looking forward to your reply. Thank you very much! Weiyi

========================================================

Sorry about screenshots.

The cv2.getBuildInformation() as follow:

GUI:

QT:                          NO
GTK+:                        NO
GThread :                    YES (ver 2.12.3)
GtkGlExt:                    NO
OpenGL support:              NO
VTK support:                 NO

But when I command cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. the information is as follow:

GUI:

QT:                          NO
GTK+:                        YES(ver 2.24.23)
GThread :                    YES (ver 2.12.3)
GtkGlExt:                    NO
OpenGL support:              NO
VTK support:                 NO

And I also notice that the cv2.getBuildInformation() gives the information :

Python 2:

Interpreter:                 python (ver 2.7.13)
Libraries:                   
numpy:                       /opt/python/cp27-cp27mu/lib/python2.7/site-packages/numpy/core/include (ver 1.11.1)
packages path:               /opt/python/cp27-cp27mu/lib/python2.7/site-packages

but I didn't find any python under opt folder and command cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. the information is as follow:

Python 2:

Interpreter:                 python (ver 2.7.6)
Libraries:                   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6)
numpy:                       /usr/local/lib/python2.7/dist-packages/numpy/core/include (ver 1.13.3)
packages path:           lib/python2.7/site-packages

I have attached some text logs above, thank you again for your repose reply

edit retag flag offensive close merge delete

Comments

please give us a TEXT version of your logs & errors, not useless screenshots. thank you !

berak gravatar imageberak ( 2017-10-13 00:41:30 -0600 )edit
1

maybe you're not using your newly built cv2.so, but some older version.

check cv2.__version__ and cv2.getBuildInformation() , and see, if that matches your expectations.

possible reasons:

  • forgot to run make install
  • virtual envs with stale copies
  • installing to one python, but using another
berak gravatar imageberak ( 2017-10-13 00:54:04 -0600 )edit
1

Thank you for quick response, I have rewrite my question above with text log.

cklmnhzve gravatar imagecklmnhzve ( 2017-10-13 02:09:43 -0600 )edit

thanks for the edit !

so, you have 2 python versions, and the new cv2 got installed to the 2.7.6 one in /usr/local

berak gravatar imageberak ( 2017-10-13 02:15:09 -0600 )edit

but the old version python2.7.13 doesn't exit in the path /opt/python/cp27-cp27mu/lib/python2.7/site-packages. my opt folder doesn't have any python

cklmnhzve gravatar imagecklmnhzve ( 2017-10-13 02:18:52 -0600 )edit

And I am sure I am using the python2.7.6

ml@ml:~/python-practice$ python

Python 2.7.6 (default, Oct 26 2016, 20:30:19)

[GCC 4.8.4] on linux2

Type "help", "copyright", "credits" or "license" for more information.

import cv2

cv2.getBuildInformation()

...

cklmnhzve gravatar imagecklmnhzve ( 2017-10-13 02:23:42 -0600 )edit