A macOS development environment setup guide and command-line tool.
The Command Line Tools Package is a small self-contained package available for download separately from Xcode and that allows you to do command line development in macOS.
-
Remove old version of the Command Line Tools:
sudo rm -rf /Library/Developer/CommandLineTools
-
Paste that in the terminal prompt:
xcode-select --install
-
A software update popup window will appear. Click
Install
, then agree to the Terms of Service when requested. -
The Command Line Tools is installed at:
/Library/Developer/CommandLineTools/
Xcode is Apple's integrated development environment (IDE) for Swift, Objective-C, C, and C++. It also supports Java, AppleScript, Python, Ruby, and ResEdit (Rez).
Download and install Xcode from the App Store or from Apple's website
Homebrew is the missing package manager for macOS.
Open the terminal and run the following script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
First update the formulae and Homebrew itself:
brew update
-
You can find out what is outdated with:
brew outdated
-
Upgrade a specific formula with:
brew upgrade <formula>
-
Or upgrade everything with:
brew upgrade
Git is a free and open source distributed version control system.
-
Paste that in the terminal prompt:
bash <(curl -fsSL raw.githubusercontent.com/monsieurborges/mac-setup/master/install) git
-
Or follow the Git set-up guide.
Apple switched to using Zsh as the default shell since October 2019. However, you can quickly switch back to Bash if you prefer.
Check out how to select your shell and set up your terminal theme:
Python is a programming language that lets you work quickly and integrate systems more effectively.
Pyenv lets you easily switch between multiple versions of Python.
-
Paste that in the terminal prompt:
bash <(curl -fsSL raw.githubusercontent.com/monsieurborges/mac-setup/master/install) python310
-
Or follow the Python set-up guide.
- TensorFlow, Keras, numpy, pandas
- scipy, scikit-learn, scikit-image, sk-video
- Matplotlib, pillow
- Jupyter lab & extensions
-
Paste that in the terminal prompt:
bash <(curl -fsSL raw.githubusercontent.com/monsieurborges/mac-setup/master/install) pypackages
-
Or follow the Python Data Science set-up guide.
Visual Studio Code is a lightweight but powerful source code editor.
Check out the VS Code set-up guide.
Microsoft created a collection of recipes for using VS Code with particular technologies (mostly Web).
Make sure to visit it at Microsoft/vscode-recipes.
MacTeX is an install package which installs everything needed to run TeX on Mac OS X.
It is easy to remove most software installed by MacTeX:
# Remove MacTeX 202X
sudo rm -rf /usr/local/texlive/202X
-
Install Ghostscript
brew install ghostscript
-
Download MacTeX from https://tug.org/mactex/mactex-download.html
-
Double click on the downloaded file to install
-
Several pages of information will be displayed
-
One of the last is shown below. Click on the
Customise
button -
Deselect the packages
Ghostscript 9.50
,Ghostscript Dynamic Library
andGUI Applications
, then click onInstall
Qt is a cross-platform application development framework for desktop, embedded and mobile using C++ or Python. Supported Platforms include Linux, OS X, Windows, VxWorks, QNX, Android, iOS, BlackBerry, Sailfish OS and others.
- Download and run the Qt online Installer
- Click
Next
on the Welcome to the Qt Online installer window - Click
Skip
on the Qt Account window - Accept the Qt Open Source Usage Obligations, and click
Continue
- Click
Continue
no the Setup - Qt window - The installer will complain that Xcode is not installed, just click
OK
- On the Qt Creator User Experience Development window, make your choice and click
Continue
- Click
Continue
on the Installation Folder window - Select the latest Qt version prebuilt components:
-
Qt 6.1.0
/macOS
-
Developer and Designer Tools
/Qt Installer Framework 3.2
-
- Then click
Next
andInstall
Paste that in the terminal prompt:
# Symbolic link
ln -s "${HOME}/Qt/Qt Creator.app" "/Applications"
FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video.
Run that in the terminal:
# Leave Python virtual environment
deactivate
# Install FFmpeg with all modules
brew install ffmpeg
OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library.
-
Uninstall old version:
CV_DIRS=( "/usr/local/share" "/usr/local/include" "/usr/local/lib" "/usr/local/bin" ) sudo -v for cv_dir in ${CV_DIRS[@]}; do sudo find ${cv_dir} -name "*opencv*" -exec rm -rf {} \; done
-
Remove installation directories:
rm -rf "${HOME}/opencv" rm -rf "${HOME}/opencv_contrib"
-
Install OpenCV following the instructions below!
-
Choose the version. Paste that in the terminal prompt:
# export OPENCV_VERSION="4.X.X" # export OPENCV_VERSION="3.4.X" export OPENCV_VERSION="4.6.0"
-
Easy install using mac-setup:
bash <(curl -fsSL raw.githubusercontent.com/monsieurborges/mac-setup/master/install) opencv
-
Or check out the OpenCV set-up guide with Qt support.
All contributions are welcome! There are many ways in which you can participate in the project, for example:
- Submit bugs and feature requests
- Review the documentation and make pull requests for anything from typos to new content
If you are interested in fixing issues and contributing directly to the code base, please read our Contribution Guide.
The source code is licensed under the MIT license.
The content of this project itself is licensed under the Creative Commons Attribution 4.0 International.