Solving issue with OpenCV not working properly with python and anaconda on Linux ( error : cv2.imshow() is not implemented )

Issue with OpenCV not working properly with python and anaconda on Linux ( error : cv2.imshow() is not implemented ) is an error which occurs because of a faulty Opencv installation.

Today, I will explain in detail why this error is happening and how to fix it in the most efficient way possible.

Exploring issue with OpenCV not working properly with python and anaconda on Linux ( error : cv2.imshow() is not implemented )

This is an error which occurs because of a faulty Opencv installation.

Bellow is the error message, please make sure it is the right one.

                                                                       #
OpenCV Error: Unspecified error (The function is not implemented...
                                                                       #

In the sections bellow we will explain the source of the problem and propose many possible fixes.

Solution 1 : Correctly install Opencv , Install Contrib etc.

This is a problem that I faced many times. the problem can be fixed by a series of commands.

First we should remove Opencv by using the command bellow

                                                                       #
conda remove opencv
                                                                       #

Now, let us install Opencv

                                                                       #
conda install -c menpo opencv
                                                                       #

Do not skip this step, because this step is very important. We should upgrade pip. By using : pip install –upgrade pip

Finally, we should install opencv-contrib-python

                                                                       #
pip install opencv-contrib-python
                                                                       #

I hope this method has worked for you, please try the method bellow if this one did not do the job.

Solution 2 : Arch Linux pkg-config and Opencv installation

This solution is for people who use Arch Linux and Anaconda

First, we will start by installing pkg-config using sudo

                                                                       #
sudo pacman -Syu pkg-config
                                                                       #

Then, you should remove opencv from the env by using the command bellow

                                                                       #
conda remove opencv
                                                                       #

Finally, use the conda-forge channel to reinstall opencv

                                                                       #
conda install -c conda-forge opencv
                                                                       #

I hope this guide solved your problem, thank you for reading my guide to the end, cheers.

Summing-up : 

That is it guys, this is the end of this article aka guide, I hope you found it useful in solving your problem, make sure to support our work on Kofi, you do not have to but hey you can donate to the team.

Thank you for reading, keep coding and cheers. If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/