简体   繁体   中英

How to run python from openCV (built from source) on the NVIDIA Jetson TX2?

I downloaded openCV from github and built it from source because I need a very specific release from openCV ie openCV2.4 . When trying to run some code written in Python, I get "No module named cv2".

I therefor tried pip install python-opencv . But this returns Could not find a version that satisfies the requirement opencv-python (from version: ) No match distribution for opencv-python

What can I do to solve the "No module named cv2" issue?

I also tried this straight in the command line

$python
>>>>import cv2

which returns no module named cv2 and

$python3
>>>>import cv2

which returns no module named cv2 as well.

I am however totally able to compile my C++ code. Which means the installation was somehow successful, but something fails on the Python side.

related to my issue: https://devtalk.nvidia.com/default/topic/809406/jetson-tk1-opencv-python-quot-import-cv2-quot-/?offset=4#5207884

and

https://devtalk.nvidia.com/default/topic/1023652/jetson-tx2/how-can-i-run-quot-pip-install-opencv-python-quot-/?offset=5#5207902

EDIT:

I was suggested to run cmake with this flag set -DBUILD_opencv_python2=ON , but this flag doesn't seem to exist because when using cmake-gui I couldn't see it anywehere and when passing it in the terminal as a paramerer I get Manually specified variables were not used by the project: BUILD_opencv_python

我能够在Jetson TX2上使用Jetpack 3.1安装OpenCV 3.4.1 for python,并在此处指示。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM