Skip to content

/tmp/pip-req-build-s8zh4qlk/opencv/modules/highgui/src/window.cpp:651 The function is not implemented #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 of 4 tasks
baskpann opened this issue Jan 21, 2021 · 5 comments

Comments

@baskpann
Copy link

Expected behaviour

Script with cv2.imshow should display output.

Actual behaviour

Traceback (most recent call last):
  File "read_image.py", line 33, in <module>
    cv2.imshow("Detected from image ", output_image)
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-s8zh4qlk/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'

Write here what went wrong.

Steps to reproduce

  • example code
output_image = cv2.resize(test_img, (1000, 700))

cv2.imshow("Detected from image ", output_image)
cv2.waitKey(0)
cv2.destroyAllWindows()
  • operating system ubuntu 20.10
  • architecture (e.g. x86) x86
  • opencv-python version => I'm using opencv-python-headless4.5.1.48 and opencv-contrib-python-headless4.5.1.48
  • Tried opencv-python and opencv-contrib-python which resulted in issue Could not load the Qt platform plugin #427
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
@skvark
Copy link
Member

skvark commented Jan 21, 2021

You should probably read the usage and installation guide from the README...

You are using headless variants, they do not have GUI (also known as imshow) support. Also, you should never install multiple different packages in the same environment.

If you encounter Qt plugin load error, then you should check that there is no PyQt installed in the same environment.

@skvark skvark closed this as completed Jan 21, 2021
@baskpann
Copy link
Author

Understood I have read the README and made changes accrodingly opencv-contrib-python is what I need. When I execute the with this package installed it prompts the following error message.

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/bas/anaconda3/lib/python3.8/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

Aborted (core dumped)

conda list

opencv-contrib-python     4.5.1.48                 pypi_0    pypi
openpyxl                  3.0.5                      py_0  
openssl                   1.1.1i               h27cfd23_0  
packaging                 20.8               pyhd3eb1b0_0  
pandas                    1.1.3            py38he6710b0_0  
pandoc                    2.11                 hb0f4dca_0  
pandocfilters             1.4.3            py38h06a4308_1  
pango                     1.45.3               hd140c19_0  
parso                     0.8.1              pyhd3eb1b0_0  
partd                     1.1.0                      py_0  
patchelf                  0.12                 h2531618_1  
path                      15.0.0                   py38_0  
path.py                   12.5.0                        0  
pathlib2                  2.3.5                    py38_0  
pathtools                 0.1.2                      py_1  
patsy                     0.5.1                    py38_0  
pcre                      8.44                 he6710b0_0  
pep8                      1.7.1                    py38_0  
pexpect                   4.8.0              pyhd3eb1b0_3  
pickleshare               0.7.5           pyhd3eb1b0_1003  
pillow                    8.0.1            py38he98fc37_0  
pip                       20.3.3           py38h06a4308_0  
pixman                    0.40.0               h7b6447c_0  
pkginfo                   1.7.0            py38h06a4308_0  
pluggy                    0.13.1                   py38_0  
ply                       3.11                     py38_0  
prometheus_client         0.9.0              pyhd3eb1b0_0  
prompt-toolkit            3.0.8                      py_0  
prompt_toolkit            3.0.8                         0  
psutil                    5.7.2            py38h7b6447c_0  
ptyprocess                0.7.0              pyhd3eb1b0_2  
py                        1.9.0                      py_0  
py-lief                   0.10.1           py38h403a769_0  
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pycodestyle               2.6.0                      py_0  
pycosat                   0.6.3            py38h7b6447c_1  
pycparser                 2.20                       py_2  
pycurl                    7.43.0.6         py38h1ba5d50_0  
pydocstyle                5.1.1                      py_0  
pyflakes                  2.2.0                      py_0  
pygments                  2.7.4              pyhd3eb1b0_0  
pylint                    2.6.0                    py38_0  
pyodbc                    4.0.30           py38he6710b0_0  
pyopenssl                 20.0.1             pyhd3eb1b0_1  
pyparsing                 2.4.7              pyhd3eb1b0_0  
pyrsistent                0.17.3           py38h7b6447c_0  
pysocks                   1.7.1            py38h06a4308_0  
pytables                  3.6.1            py38h9fd0a39_0  
pytest                    6.1.1                    py38_0  
python                    3.8.5                h7579374_1  
python-dateutil           2.8.1                      py_0  
python-jsonrpc-server     0.4.0                      py_0  
python-language-server    0.35.1                     py_0  
python-libarchive-c       2.9                pyhd3eb1b0_0  
pytz                      2020.5             pyhd3eb1b0_0  
pywavelets                1.1.1            py38h7b6447c_2  
pyxdg                     0.27               pyhd3eb1b0_0  
pyyaml                    5.3.1            py38h7b6447c_1  
pyzmq                     20.0.0           py38h2531618_1  
qdarkstyle                2.8.1                      py_0  

I made sure that there's no PyQt or qtpy. Still I'm getting this error.

  • Compliler => VS Code 2020
  • Anaconda 4.9,2
  • Ubuntu 20.10
    Could you please help me now with this issue?

@baskpann
Copy link
Author

Also when I execute the python script in a ubuntu-terminal it runs perfectly without any error. Getting this error message when I run the script in vs code terminal. Any idea why is that?

@skvark
Copy link
Member

skvark commented Jan 21, 2021

Your VS code environment is probably in some inconsistent state. VS code uses virtual environments as far as I know and they have a different set of libraries when compared to your system environment.

@skvark
Copy link
Member

skvark commented Jan 21, 2021

Please post this kind of common programming related question to Stack Overflow or some other QA forum. I'm not some generic support guy who helps with issues in your personal Python IDE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants