我在我的Mac上安裝了OpenCV 3.1,通過pip install cv2
也安裝了cv2。無法在OSX中的python中導入cv2
[email protected] $ 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
但它看起來像cv2
和cv
不能使用:
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
我已經嘗試了幾乎所有的解決方案列表在線,但不能工作。
有很多關於這方面的問題:http://stackoverflow.com/questions/15790501/why-cv2-so-missing-after-opencv-installed和http://answers.opencv.org/question/58626/ opencv-with-python-on-a-mac /和http://stackoverflow.com/questions/3325528/how-to-install-opencv-for-python和http://stackoverflow.com/questions/19876079/opencv -cannot-find-module-cv2 – udit043