0

I ran pip3 install opencv-python==3.3.0.10

but I am getting

$ python3
Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cv2'

I know there are many ways to install opencv but this one seemed the most straightforward.

Adam Jaamour
  • 1,326
  • 1
  • 15
  • 31
Liondancer
  • 15,721
  • 51
  • 149
  • 255
  • Are you sure your `pip3` is installing it for Python 3.6? I had a problem where `pip3` installed packages for 3.5 only – collector Nov 28 '17 at 13:35
  • @collector how about this ```$ pip3.6 install opencv-python Requirement already satisfied: opencv-python in /usr/local/lib/python3.6/site-packages Requirement already satisfied: numpy>=1.11.1 in /usr/local/lib/python3.6/site-packages (from opencv-python)``` – Liondancer Nov 28 '17 at 13:37
  • Are you sure all the links are pointing to the right directories? See here: https://stackoverflow.com/questions/42304140/python3-does-not-find-modules-installed-by-pip3 – collector Nov 28 '17 at 13:41
  • Check all pythons on your machine. – Kinght 金 Nov 28 '17 at 14:20

1 Answers1

0

1 - Open a terminal and pip install cmake:

pip install cmake

2 - Download opencv repository from https://github.com/opencv/opencv

3 - On your terminal cd to the folder where you downloaded the opencv repository and compile it with cmake typing the following commands:

mkdir release

cd release

cmake -D CMAKE_BULD_TYPE=RELEASE -D BUILD_PYTHON_SUPPORT=ON USE_V4L=ON WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON USE_GStreamer=ON ..

make

make install

Opencv is now correctly installed on your machine and you should be able to successfully import it in Python with no error.

Let me know if this solves the problem

Employee
  • 3,109
  • 5
  • 31
  • 50