如何在NVIDIA Jetson TX2上从openCV(从源代码构建)运行python?

时间:2017-09-06 14:53:51

标签: python c++ opencv cmake nvidia

我从github下载了openCV并从源代码构建了它,因为我需要一个来自openCV的非常具体的版本,即openCV2.4。 当试图运行一些用Python编写的代码时,我得到了#34;没有名为cv2"的模块。

我因此尝试pip install python-opencv。 但这会返回Could not find a version that satisfies the requirement opencv-python (from version: ) No match distribution for opencv-python

我该怎么做才能解决"没有名为cv2"的模块问题

我也在命令行中直接尝试了这个

$python
>>>>import cv2

不返回名为cv2和

的模块
$python3
>>>>import cv2

也不返回名为cv2的模块。

但是我完全能够编译我的C ++代码。这意味着安装在某种程度上是成功的,但在Python方面失败了。

与我的问题相关:https://devtalk.nvidia.com/default/topic/809406/jetson-tk1-opencv-python-quot-import-cv2-quot-/?offset=4#5207884

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

修改

我被建议使用此标志设置-DBUILD_opencv_python2=ON来运行cmake,但这个标志似乎不存在,因为当使用cmake-gui时我无法看到它并且在传递它时终端作为参数我获得Manually specified variables were not used by the project: BUILD_opencv_python

1 个答案:

答案 0 :(得分:0)

我能够在Jetson TX2上使用Jetpack 3.1安装OpenCV 3.4.1 for python,方向为here