python opencv on tk1

I am trying to use python opencv on a tk1
Jetpack 2.4
Based on some instruction on https://devtalk.nvidia.com/default/topic/809406/?comment=4458946 I found some instructions:

sudo apt-get install libopencv4tegra-python

which installs fine, but I still cannot import cv2 into python.
I tried installing the python packages…

pip install opencv-python
pip install python-opencv

but neither is found.
Any ideas on how to get this to run?

Hi,

Here is the steps:
1. Install opencv4tegra via JetPack

2. Install python wrapper

sudo apt-get install python-opencv

3. Test

python
import cv2
....
sudo apt-get install libopencv4tegra-python
sudo apt-get install python-opencv
python
Python 2.7.6 (default, Oct 26 2016, 20:46:32)
[GCC 4.8.4] on linux2
...
>>> import cv2
Traceback (most-recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named cv2
>>>

Hi,

Could you explain what you mean?
Does ‘sudo apt-get install python-opencv’ return error?

I resolved the problem.
I was doing all the above inside a python virtualenv and that seems to work fine, but has no effect. when I exit the virtual env it works fine.
So… to get python opencv installed, do the following outsite your virtual env:

sudo apt-get install libopencv4tegra-python
sudo apt-get install python-opencv

Ignore some posts elsewhere that instruct you to “pip install” stuff.