Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Conda environment opencv error cv2.error: what to do

Shulou Source: shulou.com Published: 2022-06-01 12:50:50 10月05日 Update

Conda environment opencv error cv2.error: what to do, I believe many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

When using opencv in a conda environment, the following error may be reported:

Cv2.error: OpenCV (4.4.0) / tmp/pip-req-build-dglzv4yn/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'

After tossing about for most of the day, I finally found a solution from stack overflow. It's super simple. Record it.

First install opencv-python using pip in the conda environment

Pip install opencv-python

Then install pencv-contrib-python

Pip install opencv-contrib-python after reading the above, you have mastered the conda environment opencv error cv2.error: what to do? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Environment what to do content method more problem helpless for this method reason this skills article experience industry information information channel error channel will report Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MariaDB Shulou Technology MySQL Apple