0

Tl;dr - after I had an issue with clashed versions between opencv and QT, I uninstalled opencv-python. But somehow I am still able to import and use cv2 inside python. How is that possible? What am I missing? Where is this opencv-python still installed?

Some more details:

  1. My tech spec: Ubuntu 18.04, Python 3.6, PyCharm Community 2020.3.

  2. My actions:

    uninstalled opencv: pip3 uninstall opencv-python (process was successful)

    validated it was indeed uninstalled: pip3 freeze | grep opencv-python (return nothing)

    validated also inside PyCharm that my environment does not have the package installed (I only work with my environment but just to make double-sure...)

  3. To my surprise:

    Inside python, import cv2 is a success, and I am able to use all functionality (well, at least the ones I tested...)

=> My question: how is this possible?

DalyaG
  • 2,979
  • 2
  • 16
  • 19

1 Answers1

0

After many frustrations, I found the answer - according to this, on Ubuntu the opencv-python installation is with apt-get:

sudo apt-get install python-opencv

Indeed I have python-opencv installed with apt-get.

The error I initially had, with the clash between the opencv and QT - was actually caused by my additional pip installation of opencv.

Conclusion - on Ubuntu, DO NOT use pip install opencv-python!

A question is remained to be asked why it is allowed to make this installation, but that's probably for another day...

DalyaG
  • 2,979
  • 2
  • 16
  • 19