I have installed OpenCV 3.1 in my Mac, cv2 is also installed through pip install cv2
.
vinllen@ $ pip install cv2 You are using pip version 7.1.0, however version 7.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Requirement already satisfied (use --upgrade to upgrade): cv2 in /usr/local/lib/python2.7/site-packages
But it looks like cv2
and cv
cannot be used:
Python 2.7.10 (default, Jul 13 2015, 12:05:58) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import cv2 Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named cv2 >>> import cv Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named cv
I have tried almost all the solutions list online, but cannot work.
importerror no module named cv2 error occurs when cv2 module is not properly installed or its path is not properly set or configured. The straight way fix for this error (no module named cv2) is to reinstall this module (OpenCV-python). In some scenario reinstalling this module automatically remove the older version.
The Python "ModuleNotFoundError: No module named 'cv2'" occurs when we forget to install the opencv-python module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install opencv-python command.
You can install by
pip install opencv-python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With