how to make pre-installed in jetson nano opencv-python visible for pip3?

Hello!

I know that opencv-python is pre-installed in jetson nano’s jetpack. But when I try “pip3 install keras-retinanet” (keras-retinanet requires opencv-python) it gives me “Error: No matching distribution found for opencv-python”. So I just can’t install keras-retinanet (and any other packages that require opencv-python) via pip.

After reading related discussions I know that pip3 can’t see opencv-python because it wasn’t installed via pip3. And I can’t install opencv-python via pip3 because there is no prebuild version for the platform.
So it feels like in order to be able to install some package that requires opencv-python via pip3 (keras-retinanet in my case) I have to make pip3 to see the pre-installed opencv. But how can I do that?

I even tried to reinstall/rebuild opencv-python from the source (as described here https://jkjung-avt.github.io/opencv-on-nano/) - but it doesn’t solve the issue - still opencv-python is not visible for pip3.

Can anyone help, please?
Thanks in advance!

Hi,

You can try to build openCV from source with python3 support.
We have an automatically script for this:
https://github.com/AastaNV/JEP/blob/master/script/install_opencv4.1.1_Jetson.sh

THanks.

Thank you for the reply, but I’ve tried to rebuild opencv and it doesn’t make it “visible” for pip3. So the issue remains.

The only workaround that I found is to use --no-dependencies key:

pip3 install <some_opencv_dependent_package> --no-dependencies

(found here https://stackoverflow.com/questions/12759761/python-pip-force-install-ignoring-dependencies)

It will allow you install <some_opencv_dependent_package> even though pip3 can’t “see” opencv-python. pip3 will annoy you with warnings though since after

Hi,

Thanks for the sharing.