close

[Solved] Module ‘cv2.cv2’ has no attribute ‘ximgproc’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Module ‘cv2.cv2’ has no attribute ‘ximgproc’ in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Module ‘cv2.cv2’ has no attribute ‘ximgproc’ Error Occurs?

Today I get the following error Module ‘cv2.cv2’ has no attribute ‘ximgproc’ in python.

How To Solve Module ‘cv2.cv2’ has no attribute ‘ximgproc’ Error ?

  1. How To Solve Module 'cv2.cv2' has no attribute 'ximgproc' Error ?

    To Solve Module 'cv2.cv2' has no attribute 'ximgproc' Error This should solve the issue, if you have pip installed. I found pip installer to be better than conda installer in general.

  2. Module 'cv2.cv2' has no attribute 'ximgproc'

    To Solve Module 'cv2.cv2' has no attribute 'ximgproc' Error This should solve the issue, if you have pip installed. I found pip installer to be better than conda installer in general.

Solution 1

As mentioned in the OpenCV pypi web page:

  1. If you have previous version of OpenCV installed remove it before installation to avoid conflicts.
  2. There are 4 different opencv packages: opencv-pythonopencv-contrib-pythonopencv-python-headlessopencv-contrib-python-headless.
  3. You can only install one. Multiple opencv packages are incompatible.

When asking my question, I had 2 opencv packages. Therefore I first removed the two existing packages:

$ pip uninstall opencv-contrib-python opencv-python

And then, I installed only one package:

$ pip install opencv-contrib-python

Finally, the installation worked.

Solution 2

This should solve the issue, if you have pip installed. I found pip installer to be better than conda installer in general.

pip install opencv-contrib-python

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read