Jetson TK1: OpenCV + Python = "import cv2"

I recently installed OpenCV and ran a sample program to ensure that it installed correctly. The sample I ran was a *.cpp file (which ran fine), however, I wanted to run the *.py files (i.e. camera.py in python folder or peopledetect.py in python2 folder). But when I go to run it I keep getting an error regarding cv2: “… import cv2; ImportError: No module named cv2”. When I check the python path to the site-packages, there are no files stored there. How do I download the proper files necessary to support running python programs for OpenCV 2.4.10 on the Jetson TK1 (r21.1)?

Thank you!

I believe this was discussed here: https://devtalk.nvidia.com/default/topic/740390/tegra-jetson-gpu-accleration-in-opencv-/

Did you install the ‘opencv4tegra’ package, or did you compile OpenCV from source? Compiling from source should install Python bindings automatically, so it looks like you’re using the NVIDIA pre-built version (“OpenCV4Tegra”).

Try installing the package ‘opencv4tegra-python’. Good luck!

Hi

Exaclty the same situation here. I tried compiling openCV from source, but that didn’t solve the binding issues. I get exactly the same error message as mentionned above: No module named cv2

I compiled it from source, because I need a very specific release of openCV (openCV2.4).

Any suggestions on how I can solve this problem when building from source?

Replied at https://devtalk.nvidia.com/default/topic/1023652/how-can-i-run-python-for-opencv-on-my-jetson-/