Question: I have installed the Open Computer Vision library on a Raspberry Pi 3 Model B with camera module, using these steps:

```
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-setuptools
sudo apt-get install python-pip
sudo apt-get install ipython python-opencv python-scipy python-numpy python-pygame

```

I would like to use this in a project using Python 3.4.2 as supplied with the device, but the `"import cv2"` statement (first line) is getting an error message `"ImportError: No module named 'cv2'"`.
This does not happen if the same file is run under Python 2.7.9, also on the Pi.

Answer: 
In Debian, Python 3 compatible packages are [explicitly named `python3-x`](https://www.debian.org/doc/packaging-manuals/python-policy/ch-module_packages.html). Packages such as `python-opencv` and `python-scipy` are the Python 2 versions of those packages; you will need to install the Python 3 versions. Packages generally don't provide Python 2 **and** 3 modules — they either offer Python 2 *or* 3 modules individually.

You will need to run:

```
sudo apt-get install python3-numpy python3-scipy

```

To install `numpy` and `scipy` for Python 3. There is no [`python3-opencv`](https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=python3-opencv) or [`python3-pygame`](https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=python3-pygame) for Stretch; you will need to follow alternative methods such as [compiling OpenCV from source](https://www.pyimagesearch.com/2017/09/04/raspbian-stretch-install-opencv-3-python-on-your-raspberry-pi/) (note that this is significantly more troublesome than just using the package, so this is a rare occasion in which I'd recommend **sticking with Python 2**).
As has been pointed out opencv2 and Python 3 are not compatible. You can however get that Python3 Experience™ at almost no extra effort by importing the future. 

To do this put this line at the very top of each file:

```
from __future__ import (absolute_import, division,
                    print_function, unicode_literals)

```

You will still need to use the python 2 version of all of your other packages but this should work.

I would recomend checking out [this](https://python-future.org/quickstart.html) article for more infomation.