I cannot find the answer to this, and I have looked quite a bit. I used the python distribution, anaconda, to install opencv for use in my python applications using the instructions on this web site,
https://rivercitylabs.org/up-and-running-with-opencv3-and-python-3-anaconda-edition/
It is very easy, it works great, and opencv is available in my python applications. I have only one problem, and it is in the nature of an annoyance: eclipse and pydev cannot see that cv2 is available, and they give the little red underline on the import cv2 statement, and claim this is an "unresolved import". I repeat, cv2 works when I run my python applications, no problem. It is just not being seen by eclipse and pydev.
I looked in the anaconda env directory where opencv is installed, and found in the lib/python3.6/site-packages directory this file:
cv2.cpython-36m-x86_64-linux-gnu.so
This folder, /anaconda-env-folder/lib/python3.6/site-packages, is of course listed on the python path for the anaconda virtual env in eclipse. Nothing would work without it. But everything else in this folder is a py file. This one is an so. Is that the problem? Eclipse and pydev cannot see this type of file, and therefore cannot give it credit for being importable? Even though python can import it?
I tried adding the directory as an external library, and I tried starting eclipse with this directory in the LD_LIBRARY_PATH, as per:
It is still an "unresolved import".
Is there a way to fix this?
Thanks for any help!
Take a look at my answer, especially at Eclipse tutorial
image.
Installing opencv on Windows 10 with python 3.6 and anaconda 3.6
Even if Windows 10, it should work also on Linux...
Also, try use cv2.cv2
syntax and see what happens..