Installing	Python	on Mac David	Hsu
https://www.python.org/
Download the Python's installer python-3.6.0-macosx10.6.pkg
PIP The instructions to install/uninstall the libraries for Python in use of pip For Python < 3.4 (without pip installed by default) on Mac OS X, in Terminal: sudo easy_install pip3 To update the version of pip for Python 3.X: pip3 install --upgrade pip For Python 3.X on Mac OS X, in Terminal: ( use pip for Python2 ) pip3 install package_name pip3 install package_name==version pip3 install --upgrade package_name pip3 uninstall package_name
List of the installing libraries Requests, the only Non-GMO HTTP library for Python. Theano, a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently.
For Python 3.X on Mac OS X, in Terminal: pip3 install numpy
For Python 3.X on Mac OS X, in Terminal: pip3 install scipy
For Python 3.X on Mac OS X, in Terminal: pip3 install matplotlib
For Python 3.X on Mac OS X, in Terminal: pip3 install sklearn
For Python 3.X on Mac OS X, in Terminal: pip3 install tensorflow
For Python 3.X on Mac OS X, in Terminal: pip3 install theano
For Python 3.X on Mac OS X, in Terminal: pip3 install pygame
For Python 3.X on Mac OS X, in Terminal: pip3 install requests
* You need to have numpy installed first before you install opencv (cv2) Download OpenCV for Mac from www.opencv.org
Once the download is done, unzip the "opencv-3.2.0.zip" file and then1. move the "opencv-3.2.0" folder under a proper directory, such as the user's Documents. e.g. /Users/davidhsu/Documents/opencv-3.2.0 2. Under the folder of "opencv-3.2.0", create a new folder and name it "build"
To install the library of openCV for Python, you also need ...
Open the application "CMake" Browse Source to the folder of "opencv-3.2.0" 1. Browse Build to the folder of "build" under opencv-3.2.0 2. Click "Configure"3.
Choose "Unix Makefiles" 1. Use default native compilers2. Click "Done"3.
Check "Configuring done" to make sure it was successful
Search "python" 1. Only check "BUILD_opencv_python3"2. If there is no "BUILD_opencv_python3" on the list, click and name it "BUILD_opencv_python3".
Set up directory for each entry of PYTHON3
Check or set up the value for each entry as followings : PYTHON3_EXECUTABLE /Library/Frameworks/Python.framework/Version/3.6/bin/python3.6 PYTHON3_INCLUDE_DIR /Library/Frameworks/Python.framework/Version/3.6/include/Python3.6m PYTHON3_LIBRARY /Library/Frameworks/Python.framework/Version/3.6/lib/libpython3.6m.dylib PYTHON3_NUMPY_INCLUDE_DIRS /Library/Frameworks/Python.framework/Version/3.6/lib/python3.6/site- packages/numpy/core/include PYTHON3_PACKAGES_PATH /Library/Frameworks/Python.framework/Version/3.6/lib/python3.6/site- packages
Click "Generate"
Check "Generating done" to make sure it was successful
In Terminal: cd /Users/davidhsu/Documents/opencv-3.2.0/build 1. make -j8 2. sudo make install3.
Or try to import the module of cv2 in Python Shell Execute python3 and import the module of cv2 to check if the installation was successful
To verify if the modules have been installed successfully, try to import each module and check its version like the followings.
Congrats, enjoy programming in Python !

Installing Python on Mac

  • 1.
  • 2.
  • 3.
    Download the Python'sinstaller python-3.6.0-macosx10.6.pkg
  • 4.
    PIP The instructions toinstall/uninstall the libraries for Python in use of pip For Python < 3.4 (without pip installed by default) on Mac OS X, in Terminal: sudo easy_install pip3 To update the version of pip for Python 3.X: pip3 install --upgrade pip For Python 3.X on Mac OS X, in Terminal: ( use pip for Python2 ) pip3 install package_name pip3 install package_name==version pip3 install --upgrade package_name pip3 uninstall package_name
  • 5.
    List of theinstalling libraries Requests, the only Non-GMO HTTP library for Python. Theano, a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently.
  • 6.
    For Python 3.Xon Mac OS X, in Terminal: pip3 install numpy
  • 7.
    For Python 3.Xon Mac OS X, in Terminal: pip3 install scipy
  • 8.
    For Python 3.Xon Mac OS X, in Terminal: pip3 install matplotlib
  • 9.
    For Python 3.Xon Mac OS X, in Terminal: pip3 install sklearn
  • 10.
    For Python 3.Xon Mac OS X, in Terminal: pip3 install tensorflow
  • 11.
    For Python 3.Xon Mac OS X, in Terminal: pip3 install theano
  • 12.
    For Python 3.Xon Mac OS X, in Terminal: pip3 install pygame
  • 13.
    For Python 3.Xon Mac OS X, in Terminal: pip3 install requests
  • 14.
    * You needto have numpy installed first before you install opencv (cv2) Download OpenCV for Mac from www.opencv.org
  • 15.
    Once the downloadis done, unzip the "opencv-3.2.0.zip" file and then1. move the "opencv-3.2.0" folder under a proper directory, such as the user's Documents. e.g. /Users/davidhsu/Documents/opencv-3.2.0 2. Under the folder of "opencv-3.2.0", create a new folder and name it "build"
  • 16.
    To install thelibrary of openCV for Python, you also need ...
  • 17.
    Open the application"CMake" Browse Source to the folder of "opencv-3.2.0" 1. Browse Build to the folder of "build" under opencv-3.2.0 2. Click "Configure"3.
  • 18.
    Choose "Unix Makefiles" 1. Usedefault native compilers2. Click "Done"3.
  • 19.
    Check "Configuring done"to make sure it was successful
  • 20.
    Search "python" 1. Only check"BUILD_opencv_python3"2. If there is no "BUILD_opencv_python3" on the list, click and name it "BUILD_opencv_python3".
  • 21.
    Set up directoryfor each entry of PYTHON3
  • 22.
    Check or setup the value for each entry as followings : PYTHON3_EXECUTABLE /Library/Frameworks/Python.framework/Version/3.6/bin/python3.6 PYTHON3_INCLUDE_DIR /Library/Frameworks/Python.framework/Version/3.6/include/Python3.6m PYTHON3_LIBRARY /Library/Frameworks/Python.framework/Version/3.6/lib/libpython3.6m.dylib PYTHON3_NUMPY_INCLUDE_DIRS /Library/Frameworks/Python.framework/Version/3.6/lib/python3.6/site- packages/numpy/core/include PYTHON3_PACKAGES_PATH /Library/Frameworks/Python.framework/Version/3.6/lib/python3.6/site- packages
  • 23.
  • 24.
    Check "Generating done"to make sure it was successful
  • 25.
  • 26.
    Or try toimport the module of cv2 in Python Shell Execute python3 and import the module of cv2 to check if the installation was successful
  • 27.
    To verify ifthe modules have been installed successfully, try to import each module and check its version like the followings.
  • 28.