# Cv2.imshow() error

**URL:** <https://forum.opencv.org/t/cv2-imshow-error/1532>\
**Category:** Uncategorized\
**Tags:** highgui, linux, build\
**Created:** [February 13, 2021, 12:47pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532 "2021-02-13T12:47:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![stupidsignup](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@stupidsignup](https://forum.opencv.org/u/stupidsignup)\
**Post date:** [February 13, 2021, 12:47pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/1 "2021-02-13T12:47:47Z")

</div>

I’ve installed opencv multiple times even compiled it but the error keeps returning.

> cv2.imshow(“Frame”,frame)  
> cv2.error: OpenCV(4.4.0) /tmp/pip-req-build-sfexxcdo/opencv/modules/highgui/src/window.cpp:651: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa 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’

so I installed install libgtk2.0-dev and pkg-config, still get this error.  
so what’s wrong?  
why does it keep returning?  
is there a “right” way to install this? because I tried pip install, apt-get install and the compile instructions.

This has been frustrating.  
thanks

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [February 13, 2021, 1:02pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/2 "2021-02-13T13:02:01Z")

</div>

welcome.

run `print(cv2.getBuildInformation())` as python code and post the output

you have several options. focus on one.

`pip install opencv-python`, that _should_ have been built with Qt or GTK. what precisely does it say when you install that (and _only_ that) and try imshow?

---

<div class="post-metadata">

**Author:** ![Supra](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/supra/32/91_2.png) [@Supra](https://forum.opencv.org/u/Supra)\
**Post date:** [February 13, 2021, 1:57pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/3 "2021-02-13T13:57:29Z")

</div>

@ [stupidsignup](https://forum.opencv.org/u/stupidsignup) R u using raspberry pi? Ur problem can be solved in 5 minutes. No needed to do **pip install opencv-python.** U shouldn’t used pip. If u r using **python 3** , then u do **pip3**. The pip is for python 2.

---

<div class="post-metadata">

**Author:** ![stupidsignup](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@stupidsignup](https://forum.opencv.org/u/stupidsignup)\
**Post date:** [February 13, 2021, 2:15pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/4 "2021-02-13T14:15:20Z")

</div>

Already tried that, as I wrote all the things I tried

---

<div class="post-metadata">

**Author:** ![stupidsignup](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@stupidsignup](https://forum.opencv.org/u/stupidsignup)\
**Post date:** [February 13, 2021, 2:17pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/5 "2021-02-13T14:17:07Z")

</div>

I’ve got python 3 running, terminal doesn’t recognise pip, only pip3. so I already tried that.

---

<div class="post-metadata">

**Author:** ![stupidsignup](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@stupidsignup](https://forum.opencv.org/u/stupidsignup)\
**Post date:** [February 13, 2021, 2:17pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/6 "2021-02-13T14:17:46Z")

</div>

Decided to remove opencv and go for tensorflow

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [February 13, 2021, 2:21pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/7 "2021-02-13T14:21:17Z")

</div>

I’m not asking you to try something you tried already. I’m asking you to gather information to track down the problem.

existing packages _should_ have given you GUI capability. if they didn’t, we need to _investigate_ why, not give up and ask for other things to try without knowing what went wrong.

you’re free to build OpenCV yourself. I’d recommend using cmake-gui for configuring variables and seeing the configuration results. it’s not a black box. it tells you why it fails.

as for the `pip` comment, on linux the naming convention is python3 and pip3 for v3 versions. the tool is _canonically_ called `pip` and the python 3 version responds to that command on non-linux platforms. it is generally understood not to use python 2 anymore, so there should be no ambiguity.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [February 13, 2021, 2:24pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/8 "2021-02-13T14:24:17Z")

</div>

those two libraries aren’t interchangeable. they do mostly different things. the only thing they have in common is inference. tensorflow doesn’t do most of what OpenCV does (image processing and vision algorithms), and OpenCV doesn’t do most of what tensorflow does (e.g. training).

---

<div class="post-metadata">

**Author:** ![stupidsignup](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@stupidsignup](https://forum.opencv.org/u/stupidsignup)\
**Post date:** [February 13, 2021, 3:23pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/9 "2021-02-13T15:23:36Z")

</div>

> General configuration for OpenCV 4.5.1 =====================================  
> Version control: 4.5.1-dirty
> 
> Platform:  
> Timestamp: 2021-01-02T13:00:02Z  
> Host: Linux 4.15.0-1077-gcp x86\_64  
> CMake: 3.18.4  
> CMake generator: Unix Makefiles  
> CMake build tool: /bin/gmake  
> Configuration: Release
> 
> CPU/HW features:  
> Baseline: SSE SSE2 SSE3  
> requested: SSE3  
> Dispatched code generation: SSE4\_1 SSE4\_2 FP16 AVX AVX2 AVX512\_SKX  
> requested: SSE4\_1 SSE4\_2 AVX FP16 AVX2 AVX512\_SKX  
> SSE4\_1 (15 files): + SSSE3 SSE4\_1  
> SSE4\_2 (1 files): + SSSE3 SSE4\_1 POPCNT SSE4\_2  
> FP16 (0 files): + SSSE3 SSE4\_1 POPCNT SSE4\_2 FP16 AVX  
> AVX (4 files): + SSSE3 SSE4\_1 POPCNT SSE4\_2 AVX  
> AVX2 (29 files): + SSSE3 SSE4\_1 POPCNT SSE4\_2 FP16 FMA3 AVX AVX2  
> AVX512\_SKX (4 files): + SSSE3 SSE4\_1 POPCNT SSE4\_2 FP16 FMA3 AVX AVX2 AVX\_512F AVX512\_COMMON AVX512\_SKX
> 
> C/C++:  
> Built as dynamic libs?: NO  
> C++ standard: 11  
> C++ Compiler: /usr/lib/ccache/compilers/c++ (ver 9.3.1)  
> C++ flags (Release): -Wl,-strip-all -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG  
> C++ flags (Debug): -Wl,-strip-all -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D\_DEBUG  
> C Compiler: /usr/lib/ccache/compilers/cc  
> C flags (Release): -Wl,-strip-all -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG  
> C flags (Debug): -Wl,-strip-all -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D\_DEBUG  
> Linker flags (Release): -Wl,–exclude-libs,libippicv.a -Wl,–exclude-libs,libippiw.a -L/root/ffmpeg\_build/lib -Wl,–gc-sections -Wl,–as-needed  
> Linker flags (Debug): -Wl,–exclude-libs,libippicv.a -Wl,–exclude-libs,libippiw.a -L/root/ffmpeg\_build/lib -Wl,–gc-sections -Wl,–as-needed  
> ccache: YES  
> Precompiled headers: NO  
> Extra dependencies: ade Qt5::Core Qt5::G ui Qt5::Widgets Qt5::Test Qt5::Concurrent /lib64/libpng.so /lib64/libz.so dl m pthread rt  
> 3rdparty dependencies: ittnotify libprotobuf libjpeg-turbo libwebp libtiff libopenjp2 IlmImf quirc ippiw ippicv
> 
> OpenCV modules:  
> To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio  
> Disabled: world  
> Disabled by dependency: -  
> Unavailable: java python2 ts  
> Applications: -  
> Documentation: NO  
> Non-free algorithms: NO
> 
> GUI:  
> QT: YES (ver 5.15.0)  
> QT OpenGL support: NO  
> GTK+: NO  
> VTK support: NO
> 
> Media I/O:  
> ZLib: /lib64/libz.so (ver 1.2.7)  
> JPEG: libjpeg-turbo (ver 2.0.6-62)  
> WEBP: build (ver encoder: 0x020f)  
> PNG: /lib64/libpng.so (ver 1.5.13)  
> TIFF: build (ver 42 - 4.0.10)  
> JPEG 2000: build (ver 2.3.1)  
> OpenEXR: build (ver 2.3.0)  
> HDR: YES  
> SUNRASTER: YES  
> PXM: YES  
> PFM: YES
> 
> Video I/O:  
> DC1394: NO  
> FFMPEG: YES  
> avcodec: YES (58.109.100)  
> avformat: YES (58.61.100)  
> avutil: YES (56.60.100)  
> swscale: YES (5.8.100)  
> avresample: NO  
> GStreamer: NO  
> v4l/v4l2: YES (linux/videodev2.h)
> 
> Parallel framework: pthreads
> 
> Trace: YES (with Intel ITT)
> 
> Other third-party libraries:  
> Intel IPP: 2020.0.0 Gold [2020.0.0]  
> at: /tmp/pip-req-build-ms668fyv/\_skbuild/linux-x86\_64-3.8/cmake-build/3rdparty/ippicv/ippicv\_lnx/icv  
> Intel IPP IW: sources (2020.0.0)  
> at: /tmp/pip-req-build-ms668fyv/\_skbuild/linux-x86\_64-3.8/cmake-build/3rdparty/ippicv/ippicv\_lnx/iw  
> Lapack: NO  
> Eigen: NO  
> Custom HAL: NO  
> Protobuf: build (3.5.1)
> 
> OpenCL: YES (no extra features)  
> Include path: /tmp/pip-req-build-ms668fyv/opencv/3rdparty/include/opencl/1.2  
> Link libraries: Dynamic load
> 
> Python 3:  
> Interpreter: /opt/python/cp38-cp38/bin/python (ver 3.8.6)  
> Libraries: libpython3.8.a (ver 3.8.6)  
> numpy: /tmp/pip-build-env-qm375ina/overlay/lib/python3.8/site-packages/numpy/core/include (ver 1.17.3)  
> install path: python
> 
> Python (for build): /bin/python2.7
> 
> Java:  
> ant: NO  
> JNI: NO  
> Java wrappers: NO  
> Java tests: NO
> 
> Install to: /tmp/pip-req-build-ms668fyv/\_skbuild/linux-x86\_64-3.8/cmake-install

idk what happend but it’s working now, consider it solved, can’t answer how.

[edit] no wait, still some errors, but the image is showing, cant stop it tho

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [February 8, 2024, 1:22pm UTC](https://forum.opencv.org/t/cv2-imshow-error/1532/11 "2024-02-08T13:22:28Z")

</div>

Closed on February 8, 2024, 1:22pm UTC


