Install Opencv-python__python under Mac

Source: Internet
Author: User

Under the Mac installation Opencv-python and Windows, the feeling is similar, here the main record of the Mac under the Opencv-python installation process.

_________________________________________________________________________________

1. If there is no homebrew, it is necessary to install first (homebrew similar to Linux Apt-get, for package management, strongly recommended. )

Address: http://brew.sh/


2. After the homebrew, we'll talk.

Brew tap homebrew/science
Brew Install OpenCV
Note: Because we often use brew's main package, we need to download the brew's sub package, such as Homebrew/science, and then install OPENCV when it comes to some less common packages. You can view additional child packages on the https://github.com/Homebrew.
3. Into the site-packages directory of Python
cd/library/python/2.7/site-packages/

4. Make soft link (download good OpenCV put in/usr/local/cellar/opencv/2.4.12_2/)
Ln-s/usr/local/cellar/opencv/2.4.12_2/lib/python2.7/site-packages/cv.py cv.py
ln-s/usr/local/Cellar/opencv/ 2.4.12_2/lib/python2.7/site-packages/cv2.so cv2.so

5. Configure environment variables (if not previously configured)
Export pythonpath= $PYTHONPATH:/usr/local/lib/python2.7/site-packages

_________________________________________________________________________________
Get. Now you can go to the console and go into the Python interactive mode >>>import cv2 >>> should not complain.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.